public abstract class BaseEntryRanker extends java.lang.Object implements java.lang.Cloneable, Options
Implementation Guide
Only two operations and the Options interface need to be defined:
Constructor and Description |
---|
BaseEntryRanker() |
Modifier and Type | Method and Description |
---|---|
BaseEntryRanker |
clone() |
boolean |
isMaximizing() |
boolean |
isUsingMeasured() |
abstract double |
objectiveFunction(BaseEntry Entry)
Some kind of objective function that returns a double when given an entry.
|
int[] |
rankEntries(Dataset Data)
Calculate the rank of entries based on this objective function
|
int[] |
rankEntries(Dataset Data,
boolean useMeasured)
Calculate the rank of entries based on this objective function
|
int[] |
rankEntries(Dataset Data,
double[] Values)
Return the rank of entries that were sorted based on the objective function defined
in this class (also depends on the settings for Maximize and Measured.
|
double[] |
runObjectiveFunction(Dataset Data)
Evaluate every entry in a dataset using the objective function
|
void |
setMaximizeFunction(boolean toMaximize)
Set whether this entry ranker will maximize objective function
|
void |
setUseMeasured(boolean useMeasured)
Set whether to used measured (or predicted) class values
|
void |
sortByRanking(Dataset data)
Sort entries in a dataset according to ranking
|
abstract void |
train(Dataset data)
Train ranker.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
printUsage, setOptions
public BaseEntryRanker clone()
clone
in class java.lang.Object
public void setUseMeasured(boolean useMeasured)
useMeasured
- Desired optionpublic boolean isUsingMeasured()
public void setMaximizeFunction(boolean toMaximize)
toMaximize
- Whether to maximize functionpublic boolean isMaximizing()
public abstract double objectiveFunction(BaseEntry Entry)
NOTE: This function needs to support using either the measured or predicted class depending on the settings
Entry
- Entry to be analyzedpublic int[] rankEntries(Dataset Data, double[] Values)
double[] Values = new double[Data.NEntries()];
Data
- Dataset containing entries to be rankedValues
- Pre-allocated, containing Data.NEntries() number of entriespublic double[] runObjectiveFunction(Dataset Data)
Data
- Dataset to be evaluatedpublic final int[] rankEntries(Dataset Data)
Data
- Dataset containing entries to be rankedpublic final int[] rankEntries(Dataset Data, boolean useMeasured)
Data
- Dataset containing entries to be rankeduseMeasured
- Whether to use measured class variablepublic abstract void train(Dataset data)
data
- Data to use as training setpublic void sortByRanking(Dataset data)
data
- Dataset to be sorted