public class AdaptiveScalarizingEntryRanker extends MultiObjectiveEntryRanker
Note: Rather than using the maximum and minimum values of each objective to mark the best/worst
this code uses the 99% and 1% percentiles. This is used to prevent a single outlier from drastically
effecting the normalized values of each objective function.
Usage: <p> -opt <maximize|minimize> <property> <ranker name> [<ranker options...>] [-opt <...>]
BaseEntryRanker
. Avoid using another multi-objective ranker
The "-opt" flag can be used multiple times, and the syntax for each additional flag is identical. Also, this function
is designed to be minimized.
Modifier and Type | Field and Description |
---|---|
protected java.util.SortedMap<java.lang.String,BaseEntryRanker> |
ObjectiveFunction
Map of property name to objective function
|
protected double[] |
ObjectiveMaximum
Maximum value of each objective function in training data
|
protected double[] |
ObjectiveMinimum
Minimum value of each objective function in training data
|
protected double |
P
Trade-off between best in single objective, and generally-good
|
protected int[] |
PropertyIndex
Index of each property of interest
|
Constructor and Description |
---|
AdaptiveScalarizingEntryRanker() |
Modifier and Type | Method and Description |
---|---|
void |
addObjectiveFunction(java.lang.String property,
BaseEntryRanker function)
Define a new objective function.
|
void |
clearObjectiveFunctions()
Clear out list of currently-defined objective functions
|
AdaptiveScalarizingEntryRanker |
clone() |
BaseEntryRanker |
getObjectiveFunction(java.lang.String property)
Get objective function for a certain property.
|
double |
getObjectivePercentile() |
java.lang.String[] |
getObjectives()
Get properties currently used in objective functions.
|
double |
getP()
Get tradeoff parameter.
|
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 |
setObjectivePercentile(double x)
Define percentile to use for approximating the minimum value of
each objective function.
|
void |
setOptions(java.util.List<java.lang.Object> Options)
Set any options for this object.
|
void |
setP(double P)
Set tradeoff parameter between optimal in single category and decent in all
|
void |
setUseMeasured(boolean useMeasured)
Set whether to used measured (or predicted) class values
|
void |
train(MultiPropertyDataset data)
Train the entry ranker.
|
train
isMaximizing, isUsingMeasured, rankEntries, rankEntries, rankEntries, runObjectiveFunction, setMaximizeFunction, sortByRanking
protected double P
protected java.util.SortedMap<java.lang.String,BaseEntryRanker> ObjectiveFunction
protected double[] ObjectiveMaximum
protected double[] ObjectiveMinimum
protected int[] PropertyIndex
public AdaptiveScalarizingEntryRanker 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 setUseMeasured(boolean useMeasured)
BaseEntryRanker
setUseMeasured
in class BaseEntryRanker
useMeasured
- Desired optionpublic void setObjectivePercentile(double x)
The maximum value is approximated as the (100 - x)% percentile
x
- Desired percentilepublic double getObjectivePercentile()
public double getP()
public void setP(double P)
P
- Desired tradeoff (should be positive) [default = 1]public void clearObjectiveFunctions()
public void addObjectiveFunction(java.lang.String property, BaseEntryRanker function)
property
- Name of property to be optimizedfunction
- Objective function for that propertypublic BaseEntryRanker getObjectiveFunction(java.lang.String property)
property
- Name of propertypublic java.lang.String[] getObjectives()
MultiObjectiveEntryRanker
getObjectives
in class MultiObjectiveEntryRanker
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 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