public class PropertyFormulaRanker extends MultiObjectiveEntryRanker
Usage: <formula...>
formula: Formula to use as objective function. Property names must be surrounded by #{}'s.
Example formula: #{volume_pa} * #{bandgap}
Constructor and Description |
---|
PropertyFormulaRanker() |
Modifier and Type | Method and Description |
---|---|
PropertyFormulaRanker |
clone() |
protected java.lang.String |
extractVariables(java.lang.String Formula)
Parse a formula to find names of properties used as variables.
|
java.lang.String[] |
getObjectives()
Get properties currently used in objective functions.
|
double |
objectiveFunction(BaseEntry Entry)
Some kind of objective function that returns a double when given an entry.
|
java.lang.String |
printUsage()
Print out required format for options.
|
void |
setFormula(java.lang.String formula)
Define the formula used by this class.
|
void |
setOptions(java.util.List<java.lang.Object> Options)
Set any options for this object.
|
void |
train(MultiPropertyDataset data)
Train the entry ranker.
|
train
isMaximizing, isUsingMeasured, rankEntries, rankEntries, rankEntries, runObjectiveFunction, setMaximizeFunction, setUseMeasured, sortByRanking
public PropertyFormulaRanker clone()
clone
in class MultiObjectiveEntryRanker
public void setOptions(java.util.List<java.lang.Object> Options) throws java.lang.Exception
Options
Options
- Array of options as Objects - can be null
java.lang.Exception
- if problem with inputspublic java.lang.String printUsage()
Options
public void train(MultiPropertyDataset data)
MultiObjectiveEntryRanker
Note: This might be an opportune operation to map the name of each property with their index to allow for faster operation of the EntryRanker#objectiveFunction(magpie.data.BaseEntry)
train
in class MultiObjectiveEntryRanker
data
- Dataset to use for trainingpublic java.lang.String[] getObjectives()
MultiObjectiveEntryRanker
getObjectives
in class MultiObjectiveEntryRanker
public void setFormula(java.lang.String formula) throws java.lang.Exception
formula
- Formula to be usedjava.lang.Exception
- If parsing failsprotected java.lang.String extractVariables(java.lang.String Formula) throws java.lang.Exception
Formula
- Formula to be parsedjava.lang.Exception
public double objectiveFunction(BaseEntry Entry)
BaseEntryRanker
NOTE: This function needs to support using either the measured or predicted class depending on the settings
objectiveFunction
in class BaseEntryRanker
Entry
- Entry to be analyzed