Package adams.data.weka.evaluator
Class AbstractCrossvalidatedInstanceEvaluator<T extends AbstractCrossvalidatedInstanceEvaluator.EvaluationContainer>
- 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
-
- adams.data.weka.evaluator.AbstractCrossvalidatedInstanceEvaluator<T>
-
- Type Parameters:
T
- the type of container
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
IntervalEstimatorBased
public abstract class AbstractCrossvalidatedInstanceEvaluator<T extends AbstractCrossvalidatedInstanceEvaluator.EvaluationContainer> extends AbstractDatasetInstanceEvaluator
Ancestor for evalutors that use cross-validation for initialization.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractCrossvalidatedInstanceEvaluator.EvaluationContainer
Container for storing the evaluation results.
-
Field Summary
Fields Modifier and Type Field Description protected int
m_Folds
the number of folds for cross-validation.protected int
m_Seed
the random seed for cross-valiation.-
Fields inherited from class adams.data.weka.evaluator.AbstractDatasetInstanceEvaluator
m_Data, m_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 AbstractCrossvalidatedInstanceEvaluator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected abstract Vector<T>
evaluate(weka.core.Instances train, weka.core.Instances test)
Performs an evaluation on the given train and test set.protected String
findThreshold()
Finds the user-defined threshold and sets other internal variables accordingly.protected abstract String
findThreshold(Vector<T> evals)
Finds the threshold based on the collected data.String
foldsTipText()
Returns the tip text for this property.int
getFolds()
Returns the number of folds for cross-validation.int
getSeed()
Returns the seed value for cross-validation.String
seedTipText()
Returns the tip text for this property.void
setFolds(int value)
Sets the number of folds for cross-validation.void
setSeed(int value)
Sets the seed value for cross-validation.-
Methods inherited from class adams.data.weka.evaluator.AbstractDatasetInstanceEvaluator
cleanUp, getData, getThreshold, reset, setData, setThreshold, setUp, split, thresholdTipText
-
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 classAbstractDatasetInstanceEvaluator
-
setFolds
public void setFolds(int value)
Sets the number of folds for cross-validation.- Parameters:
value
- the number of folds (<2 turns off cross-validation)
-
getFolds
public int getFolds()
Returns the number of folds for cross-validation.- Returns:
- the number of folds (<2 turns off cross-validation)
-
foldsTipText
public String foldsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSeed
public void setSeed(int value)
Sets the seed value for cross-validation.- Parameters:
value
- the seed
-
getSeed
public int getSeed()
Returns the seed value for cross-validation.- Returns:
- the seed
-
seedTipText
public String seedTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
findThreshold
protected abstract String findThreshold(Vector<T> evals)
Finds the threshold based on the collected data.- Parameters:
evals
- the collected evaluation containers- Returns:
- null if everything OK, error message otherwise
-
evaluate
protected abstract Vector<T> evaluate(weka.core.Instances train, weka.core.Instances test)
Performs an evaluation on the given train and test set.- Parameters:
train
- the training settest
- the test set- Returns:
- the generated evaluation container
-
findThreshold
protected String findThreshold()
Finds the user-defined threshold and sets other internal variables accordingly.- Specified by:
findThreshold
in classAbstractDatasetInstanceEvaluator
- Returns:
- null if everything OK, error message otherwise
-
-