adams.flow.sink
Class WekaExperimentGenerator

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.flow.core.AbstractActor
              extended by adams.flow.sink.AbstractSink
                  extended by adams.flow.sink.WekaExperimentGenerator
All Implemented Interfaces:
AdditionalInformationHandler, CleanUpHandler, Debuggable, DebugOutputHandler, Destroyable, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<AbstractActor>, SizeOfHandler, Stoppable, VariableChangeListener, 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: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Nested Class Summary
static class WekaExperimentGenerator.EvaluationType
          The evaluation type.
static class WekaExperimentGenerator.ExperimentType
          The experiment type.
static class WekaExperimentGenerator.ResultFormat
          The data format the experiment data is stored in.
 
Field Summary
protected  WekaExperimentGenerator.EvaluationType m_EvaluationType
          the type of evaluation.
protected  WekaExperimentGenerator.ExperimentType m_ExperimentType
          the type of experiment.
protected  int m_Folds
          the number of folds to use (only cross-validation).
protected  PlaceholderFile m_OutputFile
          the file to store the experiment in.
protected  PlaceholderFile m_ResultFile
          the file to store the result in.
protected  WekaExperimentGenerator.ResultFormat m_ResultFormat
          the result format.
protected  int m_Runs
          the number of runs to perform.
protected  double m_SplitPercentage
          the split-percentage to use (only train/test splits).
 
Fields inherited from class adams.flow.sink.AbstractSink
BACKUP_INPUT, m_InputToken
 
Fields inherited from class adams.flow.core.AbstractActor
FILE_EXTENSION, FILE_EXTENSION_GZ, m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_FullName, m_Headless, m_Name, m_Parent, m_Root, m_Self, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
WekaExperimentGenerator()
           
 
Method Summary
 Class[] accepts()
          Returns the class that the consumer accepts.
 void defineOptions()
          Adds options to the internal list of options.
protected  String doExecute()
          Executes the flow item.
 String evaluationTypeTipText()
          Returns the tip text for this property.
 String experimentTypeTipText()
          Returns the tip text for this property.
 String foldsTipText()
          Returns the tip text for this property.
 WekaExperimentGenerator.EvaluationType getEvaluationType()
          Returns the type of evaluation to perform.
 WekaExperimentGenerator.ExperimentType getExperimentType()
          Returns the type of experiment to perform.
 int getFolds()
          Returns the number of folds to use (only CV).
 PlaceholderFile getOutputFile()
          Returns the file to store the experiment in.
 String getQuickInfo()
          Returns a quick info about the actor, which will be displayed in the GUI.
 PlaceholderFile getResultFile()
          Returns the file to store the experimental results in.
 WekaExperimentGenerator.ResultFormat getResultFormat()
          Returns the data format the results are stored in.
 int getRuns()
          Returns the number of runs to perform.
 double getSplitPercentage()
          Returns the split percentage (only train/test splits).
 String globalInfo()
          Returns a string describing the object.
 String outputFileTipText()
          Returns the tip text for this property.
 String resultFileTipText()
          Returns the tip text for this property.
 String resultFormatTipText()
          Returns the tip text for this property.
 String runsTipText()
          Returns the tip text for this property.
 void setEvaluationType(WekaExperimentGenerator.EvaluationType value)
          Sets the type of evaluation to perform.
 void setExperimentType(WekaExperimentGenerator.ExperimentType value)
          Sets the type of experiment to perform.
 void setFolds(int value)
          Sets the number of folds to use (only CV).
 void setOutputFile(PlaceholderFile value)
          Sets the file to store the experiment setup in (the extensions determines the type).
 void setResultFile(PlaceholderFile value)
          Sets the file to store the experimental results in.
 void setResultFormat(WekaExperimentGenerator.ResultFormat value)
          Sets the data format the results are stored in.
 void setRuns(int value)
          Sets the number of runs to perform.
 void setSplitPercentage(double value)
          Sets the split percentage (only train/test splits).
 String setUp()
          Initializes the item for flow execution.
 String splitPercentageTipText()
          Returns the tip text for this property.
 
Methods inherited from class adams.flow.sink.AbstractSink
backupState, input, restoreState, wrapUp
 
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, canInspectOptions, canPerformSetUpCheck, cleanUp, compareTo, debug, destroy, equals, execute, findVariables, findVariables, findVariables, forceVariables, forCommandLine, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFullName, getName, getNextSibling, getParent, getPreviousSibling, getRoot, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, initialize, isBackedUp, isExecuted, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, postExecute, preExecute, pruneBackup, pruneBackup, reset, setAnnotations, setErrorHandler, setHeadless, setName, setParent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, sizeOf, skipTipText, stopExecution, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_ExperimentType

protected WekaExperimentGenerator.ExperimentType m_ExperimentType
the type of experiment.


m_EvaluationType

protected WekaExperimentGenerator.EvaluationType m_EvaluationType
the type of evaluation.


m_Runs

protected int m_Runs
the number of runs to perform.


m_Folds

protected int m_Folds
the number of folds to use (only cross-validation).


m_SplitPercentage

protected double m_SplitPercentage
the split-percentage to use (only train/test splits).


m_ResultFormat

protected WekaExperimentGenerator.ResultFormat m_ResultFormat
the result format.


m_ResultFile

protected PlaceholderFile m_ResultFile
the file to store the result in.


m_OutputFile

protected PlaceholderFile m_OutputFile
the file to store the experiment in.

Constructor Detail

WekaExperimentGenerator

public WekaExperimentGenerator()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the object.

Specified by:
globalInfo in class 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 OptionHandler
Overrides:
defineOptions in class AbstractActor

getQuickInfo

public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.

Specified by:
getQuickInfo in interface QuickInfoSupporter
Overrides:
getQuickInfo in class AbstractActor
Returns:
null if no info available, otherwise short string

setExperimentType

public void setExperimentType(WekaExperimentGenerator.ExperimentType value)
Sets the type of experiment to perform.

Parameters:
value - the type

getExperimentType

public WekaExperimentGenerator.ExperimentType getExperimentType()
Returns the type of experiment to perform.

Returns:
the type

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.

setEvaluationType

public void setEvaluationType(WekaExperimentGenerator.EvaluationType value)
Sets the type of evaluation to perform.

Parameters:
value - the type

getEvaluationType

public WekaExperimentGenerator.EvaluationType getEvaluationType()
Returns the type of evaluation to perform.

Returns:
the type

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.

setResultFormat

public void setResultFormat(WekaExperimentGenerator.ResultFormat value)
Sets the data format the results are stored in.

Parameters:
value - the format

getResultFormat

public WekaExperimentGenerator.ResultFormat getResultFormat()
Returns the data format the results are stored in.

Returns:
the format

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

setUp

public String setUp()
Initializes the item for flow execution.

Overrides:
setUp in class AbstractActor
Returns:
null if everything is fine, otherwise error message

doExecute

protected String doExecute()
Executes the flow item.

Specified by:
doExecute in class AbstractActor
Returns:
null if everything is fine, otherwise error message


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