Package adams.data.weka.evaluator
Class AbstractDatasetInstanceEvaluator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.weka.evaluator.AbstractInstanceEvaluator
-
- adams.data.weka.evaluator.AbstractDatasetInstanceEvaluator
-
- All Implemented Interfaces:
adams.core.CleanUpHandler,adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.SizeOfHandler,Serializable
- Direct Known Subclasses:
AbstractCrossvalidatedInstanceEvaluator
public abstract class AbstractDatasetInstanceEvaluator extends AbstractInstanceEvaluator
Ancestor for evaluators that need a data set for initialization.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected weka.core.Instancesm_Datathe data set to use for training and other bits.protected doublem_Thresholdthe percentage to the threshold.-
Fields inherited from class adams.data.weka.evaluator.AbstractInstanceEvaluator
m_Initialized
-
-
Constructor Summary
Constructors Constructor Description AbstractDatasetInstanceEvaluator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcleanUp()Cleans up data structures, frees up memory.voiddefineOptions()Adds options to the internal list of options.protected abstract StringfindThreshold()Finds the user-defined threshold and sets other internal variables accordingly.weka.core.InstancesgetData()Returns the data to use for training and so forth.doublegetThreshold()Returns the threshold.protected voidreset()Resets the scheme.voidsetData(weka.core.Instances value)Sets the data set to use for training and so forth.voidsetThreshold(double value)Sets the threshold.protected StringsetUp()Performs necessary initializations before being able to evaluate.protected weka.core.Instances[]split(weka.core.Instances data, double percentage)Splits the dataset into two separate ones, according to the specified percentage (0-1).StringthresholdTipText()Returns the tip text for this property.-
Methods inherited from class adams.data.weka.evaluator.AbstractInstanceEvaluator
check, compareTo, destroy, doEvaluate, equals, evaluate, forCommandLine, forName, getEvaluators, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.core.option.AbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classAbstractInstanceEvaluator
-
setData
public void setData(weka.core.Instances value)
Sets the data set to use for training and so forth.- Parameters:
value- the data set
-
getData
public weka.core.Instances getData()
Returns the data to use for training and so forth.- Returns:
- the data set, can be null if not yet set
-
setThreshold
public void setThreshold(double value)
Sets the threshold.- Parameters:
value- the threshold (0-1)
-
getThreshold
public double getThreshold()
Returns the threshold.- Returns:
- the threshold (0-1)
-
thresholdTipText
public String thresholdTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
split
protected weka.core.Instances[] split(weka.core.Instances data, double percentage)Splits the dataset into two separate ones, according to the specified percentage (0-1).- Parameters:
data- the data to splitpercentage- the percentage of the split (0-1)- Returns:
- the array with the two datasets generated
-
findThreshold
protected abstract String findThreshold()
Finds the user-defined threshold and sets other internal variables accordingly.- Returns:
- null if everything OK, error message otherwise
-
setUp
protected String setUp()
Performs necessary initializations before being able to evaluate.- Overrides:
setUpin classAbstractInstanceEvaluator- Returns:
- null if everything fine, error message otherwise
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceadams.core.CleanUpHandler- Overrides:
cleanUpin classAbstractInstanceEvaluator- See Also:
m_Data
-
-