adams.data.weka.evaluator
Class AbstractCrossvalidatedInstanceEvaluator<T extends AbstractCrossvalidatedInstanceEvaluator.EvaluationContainer>

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.data.weka.evaluator.AbstractInstanceEvaluator
              extended by adams.data.weka.evaluator.AbstractDatasetInstanceEvaluator
                  extended by adams.data.weka.evaluator.AbstractCrossvalidatedInstanceEvaluator<T>
Type Parameters:
T - the type of container
All Implemented Interfaces:
CleanUpHandler, Debuggable, Destroyable, 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: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Nested Class Summary
static class AbstractCrossvalidatedInstanceEvaluator.EvaluationContainer
          Container for storing the evaluation results.
 
Field Summary
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_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractCrossvalidatedInstanceEvaluator()
           
 
Method Summary
 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, debug, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, globalInfo, initialize, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Folds

protected int m_Folds
the number of folds for cross-validation.


m_Seed

protected int m_Seed
the random seed for cross-valiation.

Constructor Detail

AbstractCrossvalidatedInstanceEvaluator

public AbstractCrossvalidatedInstanceEvaluator()
Method Detail

defineOptions

public void defineOptions()
Adds options to the internal list of options.

Specified by:
defineOptions in interface OptionHandler
Overrides:
defineOptions in class AbstractDatasetInstanceEvaluator

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 set
test - 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 class AbstractDatasetInstanceEvaluator
Returns:
null if everything OK, error message otherwise


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.