Class 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.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.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • 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.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 interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • 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 adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • 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 adams.core.CleanUpHandler
        Overrides:
        cleanUp in class AbstractInstanceEvaluator
        See Also:
        m_Data