Class InstancesIndexedSplitsRunsEvaluation

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.SizeOfHandler, adams.core.Stoppable, adams.core.StoppableWithFeedback, adams.flow.core.FlowContextHandler, adams.flow.transformer.indexedsplitsrunsevaluation.IndexedSplitsRunsEvaluation<weka.core.Instances,​WekaEvaluationContainer[]>, Serializable

    public class InstancesIndexedSplitsRunsEvaluation
    extends adams.flow.transformer.indexedsplitsrunsevaluation.AbstractIndexedSplitsRunsEvaluation<weka.core.Instances,​WekaEvaluationContainer[]>
    Evaluates the specified classifier on the indexed splits runs applied to the incoming data.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.flow.core.CallableActorReference m_Classifier
      the name of the callable weka classifier.
      protected boolean m_DiscardPredictions
      whether to discard predictions.
      protected weka.classifiers.Classifier m_ManualClassifier
      a programmatically supplied classifier.
      protected String m_TestSplitName
      the split to use for testing.
      protected String m_TrainSplitName
      the split to use for training.
      • Fields inherited from class adams.flow.transformer.indexedsplitsrunsevaluation.AbstractIndexedSplitsRunsEvaluation

        m_FlowContext, m_Stopped
      • 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 Concrete Methods 
      Modifier and Type Method Description
      Class accepts()
      The accepted classes.
      protected Map<String,​weka.core.Instances> applyIndexedSplit​(adams.data.indexedsplits.IndexedSplit indexedSplit, weka.core.Instances data)
      Applies the splits defined in the indexed split and returns the generated subsets.
      String classifierTipText()
      Returns the tip text for this property.
      void defineOptions()
      Adds options to the internal list of options.
      String discardPredictionsTipText()
      Returns the tip text for this property.
      protected WekaEvaluationContainer[] doEvaluate​(weka.core.Instances data, adams.data.indexedsplits.IndexedSplitsRuns runs, adams.core.MessageCollection errors)
      Performs an evaluation by applying the indexed splits runs to the data.
      Class generates()
      The generated classes.
      adams.flow.core.CallableActorReference getClassifier()
      Returns the name of the callable classifier in use.
      protected weka.classifiers.Classifier getClassifierInstance​(adams.core.MessageCollection errors)
      Returns an instance of the callable classifier.
      boolean getDiscardPredictions()
      Returns whether to discard the predictions in order to preserve memory.
      weka.classifiers.Classifier getManualClassifier()
      Returns the manual to use instead of obtaining it from the flow.
      String getQuickInfo()
      Returns a quick info about the actor, which will be displayed in the GUI.
      String getTestSplitName()
      Returns the name of the split to use for testing.
      String getTrainSplitName()
      Returns the name of the split to use for training.
      String globalInfo()
      Returns a string describing the object.
      boolean requiresFlowContext()
      Returns whether flow context is actually required.
      void setClassifier​(adams.flow.core.CallableActorReference value)
      Sets the name of the callable classifier to use.
      void setDiscardPredictions​(boolean value)
      Sets whether to discard the predictions instead of collecting them for future use, in order to conserve memory.
      void setManualClassifier​(weka.classifiers.Classifier value)
      Sets the manual classifier to use instead of obtaining it from the flow.
      void setTestSplitName​(String value)
      Sets the name of the split to use for testing.
      void setTrainSplitName​(String value)
      Sets the name of the split to use for training.
      String testSplitNameTipText()
      Returns the tip text for this property.
      String trainSplitNameTipText()
      Returns the tip text for this property.
      • Methods inherited from class adams.flow.transformer.indexedsplitsrunsevaluation.AbstractIndexedSplitsRunsEvaluation

        check, evaluate, getFlowContext, isStopped, setFlowContext, stopExecution
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.Destroyable

        destroy
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
      • Methods inherited from interface adams.core.option.OptionHandler

        cleanUpOptions, getOptionManager, toCommandLine
    • Field Detail

      • m_TrainSplitName

        protected String m_TrainSplitName
        the split to use for training.
      • m_TestSplitName

        protected String m_TestSplitName
        the split to use for testing.
      • m_Classifier

        protected adams.flow.core.CallableActorReference m_Classifier
        the name of the callable weka classifier.
      • m_DiscardPredictions

        protected boolean m_DiscardPredictions
        whether to discard predictions.
      • m_ManualClassifier

        protected weka.classifiers.Classifier m_ManualClassifier
        a programmatically supplied classifier.
    • Constructor Detail

      • InstancesIndexedSplitsRunsEvaluation

        public InstancesIndexedSplitsRunsEvaluation()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • 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
      • setTrainSplitName

        public void setTrainSplitName​(String value)
        Sets the name of the split to use for training.
        Parameters:
        value - the name
      • getTrainSplitName

        public String getTrainSplitName()
        Returns the name of the split to use for training.
        Returns:
        the name
      • trainSplitNameTipText

        public String trainSplitNameTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setTestSplitName

        public void setTestSplitName​(String value)
        Sets the name of the split to use for testing.
        Parameters:
        value - the name
      • getTestSplitName

        public String getTestSplitName()
        Returns the name of the split to use for testing.
        Returns:
        the name
      • testSplitNameTipText

        public String testSplitNameTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setClassifier

        public void setClassifier​(adams.flow.core.CallableActorReference value)
        Sets the name of the callable classifier to use.
        Parameters:
        value - the name
      • getClassifier

        public adams.flow.core.CallableActorReference getClassifier()
        Returns the name of the callable classifier in use.
        Returns:
        the name
      • classifierTipText

        public String classifierTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setDiscardPredictions

        public void setDiscardPredictions​(boolean value)
        Sets whether to discard the predictions instead of collecting them for future use, in order to conserve memory.
        Parameters:
        value - true if to discard predictions
      • getDiscardPredictions

        public boolean getDiscardPredictions()
        Returns whether to discard the predictions in order to preserve memory.
        Returns:
        true if predictions discarded
      • discardPredictionsTipText

        public String discardPredictionsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setManualClassifier

        public void setManualClassifier​(weka.classifiers.Classifier value)
        Sets the manual classifier to use instead of obtaining it from the flow.
        Parameters:
        value - the classifier
      • getManualClassifier

        public weka.classifiers.Classifier getManualClassifier()
        Returns the manual to use instead of obtaining it from the flow.
        Returns:
        the classifier
      • accepts

        public Class accepts()
        The accepted classes.
        Returns:
        the array of accepted types
      • generates

        public Class generates()
        The generated classes.
        Returns:
        the array of generated types
      • requiresFlowContext

        public boolean requiresFlowContext()
        Returns whether flow context is actually required.
        Specified by:
        requiresFlowContext in class adams.flow.transformer.indexedsplitsrunsevaluation.AbstractIndexedSplitsRunsEvaluation<weka.core.Instances,​WekaEvaluationContainer[]>
        Returns:
        true if required
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the actor, which will be displayed in the GUI.
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Overrides:
        getQuickInfo in class adams.flow.transformer.indexedsplitsrunsevaluation.AbstractIndexedSplitsRunsEvaluation<weka.core.Instances,​WekaEvaluationContainer[]>
        Returns:
        null if no info available, otherwise short string
      • getClassifierInstance

        protected weka.classifiers.Classifier getClassifierInstance​(adams.core.MessageCollection errors)
        Returns an instance of the callable classifier.
        Parameters:
        errors - for collecting errors
        Returns:
        the classifier
      • applyIndexedSplit

        protected Map<String,​weka.core.Instances> applyIndexedSplit​(adams.data.indexedsplits.IndexedSplit indexedSplit,
                                                                          weka.core.Instances data)
        Applies the splits defined in the indexed split and returns the generated subsets.
        Parameters:
        indexedSplit - the run to apply
        data - the data to obtain the subsets from
        Returns:
        the generated splits
      • doEvaluate

        protected WekaEvaluationContainer[] doEvaluate​(weka.core.Instances data,
                                                       adams.data.indexedsplits.IndexedSplitsRuns runs,
                                                       adams.core.MessageCollection errors)
        Performs an evaluation by applying the indexed splits runs to the data.
        Specified by:
        doEvaluate in class adams.flow.transformer.indexedsplitsrunsevaluation.AbstractIndexedSplitsRunsEvaluation<weka.core.Instances,​WekaEvaluationContainer[]>
        Parameters:
        data - the data to use for evaluation
        runs - the indexed splits to use
        errors - for collecting errors
        Returns:
        the generated evaluations, null in case of error