Class TrainTestSplitExperiment

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.core.Stoppable, adams.core.StoppableWithFeedback, adams.data.spreadsheet.SpreadSheetSupporter, ExperimentWithCustomizableRelationNames, ResettableExperiment, Serializable

    public class TrainTestSplitExperiment
    extends AbstractExperiment
    Performs train-test splits.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Percentage

        protected double m_Percentage
        the split percentage.
      • m_PreserveOrder

        protected boolean m_PreserveOrder
        whether to preserve the order.
    • Constructor Detail

      • TrainTestSplitExperiment

        public TrainTestSplitExperiment()
    • 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 AbstractExperiment
      • setPercentage

        public void setPercentage​(double value)
        Sets the split percentage.
        Parameters:
        value - the percentage
      • getPercentage

        public double getPercentage()
        Returns the split percentage.
        Returns:
        the percentage
      • percentageTipText

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

        public void setPreserveOrder​(boolean value)
        Sets whether to preserve the order.
        Parameters:
        value - true if to preserve
      • getPreserveOrder

        public boolean getPreserveOrder()
        Returns whether to preserve the order.
        Returns:
        true if to preserve
      • preserveOrderTipText

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

        public void setGenerator​(RandomSplitGenerator value)
        Sets the scheme for generating the split.
        Parameters:
        value - the generator
      • getGenerator

        public RandomSplitGenerator getGenerator()
        Returns the scheme for generating the split.
        Returns:
        the generator
      • generatorTipText

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

        protected TrainTestSplitExperiment.TrainTestSplitExperimentJob evaluate​(int currentRun,
                                                                                weka.classifiers.Classifier cls,
                                                                                weka.core.Instances data)
        Evaluates the classifier on the dataset.
        Specified by:
        evaluate in class AbstractExperiment
        Parameters:
        currentRun - the current run
        cls - the classifier to evaluate
        data - the dataset to evaluate on
        Returns:
        null if successful, otherwise error message