adams.data.weka.evaluator
Class AbstractDatasetInstanceEvaluator

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
All Implemented Interfaces:
CleanUpHandler, Debuggable, Destroyable, 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: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
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_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractDatasetInstanceEvaluator()
           
 
Method Summary
 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, 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_Data

protected weka.core.Instances m_Data
the data set to use for training and other bits.


m_Threshold

protected double m_Threshold
the percentage to the threshold.

Constructor Detail

AbstractDatasetInstanceEvaluator

public AbstractDatasetInstanceEvaluator()
Method Detail

defineOptions

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

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

reset

protected void reset()
Resets the scheme.

Overrides:
reset in class AbstractInstanceEvaluator

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 split
percentage - 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 class AbstractInstanceEvaluator
Returns:
null if everything fine, error message otherwise

cleanUp

public void cleanUp()
Cleans up data structures, frees up memory.

Specified by:
cleanUp in interface CleanUpHandler
Overrides:
cleanUp in class AbstractInstanceEvaluator
See Also:
m_Data


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