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:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,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.Instances
m_Data
the data set to use for training and other bits.protected double
m_Threshold
the percentage to the threshold.-
Fields inherited from class adams.data.weka.evaluator.AbstractInstanceEvaluator
m_Initialized
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractDatasetInstanceEvaluator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Cleans up data structures, frees up memory.void
defineOptions()
Adds options to the internal list of options.protected abstract String
findThreshold()
Finds the user-defined threshold and sets other internal variables accordingly.weka.core.Instances
getData()
Returns the data to use for training and so forth.double
getThreshold()
Returns the threshold.protected void
reset()
Resets the scheme.void
setData(weka.core.Instances value)
Sets the data set to use for training and so forth.void
setThreshold(double value)
Sets the threshold.protected String
setUp()
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).String
thresholdTipText()
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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in 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:
setUp
in classAbstractInstanceEvaluator
- Returns:
- null if everything fine, error message otherwise
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceCleanUpHandler
- Overrides:
cleanUp
in classAbstractInstanceEvaluator
- See Also:
m_Data
-
-