Class WekaExperimentGenerator

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ErrorHandler, InputConsumer, Serializable, Comparable

    public class WekaExperimentGenerator
    extends AbstractSink
    Generates an experiment setup that can be used in conjunction with the Experiment transformer actor.

    Input/output:
    - accepts:
       weka.classifiers.Classifier[]


    Valid options are:

    -D <int> (property: debugLevel)
        The greater the number the more additional info the scheme may output to
        the console (0 = off).
        default: 0
        minimum: 0
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: ExperimentGenerator
     
    -annotation <adams.core.base.BaseText> (property: annotations)
        The annotations to attach to this actor.
        default:
     
    -skip (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded
        as it is.
     
    -exp-type <CLASSIFICATION|REGRESSION> (property: experimentType)
        The type of experiment to perform.
        default: CLASSIFICATION
     
    -eval-type <CROSS_VALIDATION|TRAIN_TEST_SPLIT_RANDOMIZED|TRAIN_TEST_SPLIT_ORDER_PRESERVED> (property: evaluationType)
        The type of evaluation to perform.
        default: CROSS_VALIDATION
     
    -runs <int> (property: runs)
        The number of runs to perform.
        default: 10
        minimum: 1
     
    -folds <int> (property: folds)
        The number of folds to use in cross-validation.
        default: 10
        minimum: 2
     
    -split <double> (property: splitPercentage)
        The percentage to use in train/test splits.
        default: 66.0
        minimum: 1.0E-4
        maximum: 99.9999
     
    -result-format <ARFF|CSV> (property: resultFormat)
        The data format the experimental results are stored in.
        default: ARFF
     
    -result-file <adams.core.io.PlaceholderFile> (property: resultFile)
        The file to store the experimental results in.
        default: .
     
    -output <adams.core.io.PlaceholderFile> (property: outputFile)
        The file to store the experiment setup in (the extension determines the
        type).
        default: .
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • WekaExperimentGenerator

        public WekaExperimentGenerator()
    • Method Detail

      • experimentTypeTipText

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

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

        public void setRuns​(int value)
        Sets the number of runs to perform.
        Parameters:
        value - the runs
      • getRuns

        public int getRuns()
        Returns the number of runs to perform.
        Returns:
        the runs
      • runsTipText

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

        public void setFolds​(int value)
        Sets the number of folds to use (only CV).
        Parameters:
        value - the folds
      • getFolds

        public int getFolds()
        Returns the number of folds to use (only CV).
        Returns:
        the folds
      • 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.
      • setSplitPercentage

        public void setSplitPercentage​(double value)
        Sets the split percentage (only train/test splits).
        Parameters:
        value - the percentage (0-100)
      • getSplitPercentage

        public double getSplitPercentage()
        Returns the split percentage (only train/test splits).
        Returns:
        the data format
      • splitPercentageTipText

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

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

        public void setResultFile​(PlaceholderFile value)
        Sets the file to store the experimental results in.
        Parameters:
        value - the file
      • getResultFile

        public PlaceholderFile getResultFile()
        Returns the file to store the experimental results in.
        Returns:
        the file
      • resultFileTipText

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

        public void setOutputFile​(PlaceholderFile value)
        Sets the file to store the experiment setup in (the extensions determines the type).
        Parameters:
        value - the file
      • getOutputFile

        public PlaceholderFile getOutputFile()
        Returns the file to store the experiment in.
        Returns:
        the file
      • outputFileTipText

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

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Returns:
        weka.classifiers.Classifier[].class
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message