Package adams.flow.sink
Class WekaExperimentGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.AbstractActor
-
- adams.flow.sink.AbstractSink
-
- adams.flow.sink.WekaExperimentGenerator
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler,adams.core.CleanUpHandler,adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.QuickInfoSupporter,adams.core.ShallowCopySupporter<adams.flow.core.Actor>,adams.core.SizeOfHandler,adams.core.Stoppable,adams.core.StoppableWithFeedback,adams.core.VariablesInspectionHandler,adams.event.VariableChangeListener,adams.flow.core.Actor,adams.flow.core.ErrorHandler,adams.flow.core.InputConsumer,Serializable,Comparable
public class WekaExperimentGenerator extends adams.flow.sink.AbstractSinkGenerates 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWekaExperimentGenerator.EvaluationTypeThe evaluation type.static classWekaExperimentGenerator.ExperimentTypeThe experiment type.static classWekaExperimentGenerator.ResultFormatThe data format the experiment data is stored in.
-
Field Summary
Fields Modifier and Type Field Description protected WekaExperimentGenerator.EvaluationTypem_EvaluationTypethe type of evaluation.protected WekaExperimentGenerator.ExperimentTypem_ExperimentTypethe type of experiment.protected intm_Foldsthe number of folds to use (only cross-validation).protected adams.core.io.PlaceholderFilem_OutputFilethe file to store the experiment in.protected adams.core.io.PlaceholderFilem_ResultFilethe file to store the result in.protected WekaExperimentGenerator.ResultFormatm_ResultFormatthe result format.protected intm_Runsthe number of runs to perform.protected doublem_SplitPercentagethe split-percentage to use (only train/test splits).-
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_LoggingPrefix, m_Name, m_Parent, m_ScopeHandler, m_Self, m_Silent, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
-
-
Constructor Summary
Constructors Constructor Description WekaExperimentGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]accepts()Returns the class that the consumer accepts.voiddefineOptions()Adds options to the internal list of options.protected StringdoExecute()Executes the flow item.StringevaluationTypeTipText()Returns the tip text for this property.StringexperimentTypeTipText()Returns the tip text for this property.StringfoldsTipText()Returns the tip text for this property.WekaExperimentGenerator.EvaluationTypegetEvaluationType()Returns the type of evaluation to perform.WekaExperimentGenerator.ExperimentTypegetExperimentType()Returns the type of experiment to perform.intgetFolds()Returns the number of folds to use (only CV).adams.core.io.PlaceholderFilegetOutputFile()Returns the file to store the experiment in.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.adams.core.io.PlaceholderFilegetResultFile()Returns the file to store the experimental results in.WekaExperimentGenerator.ResultFormatgetResultFormat()Returns the data format the results are stored in.intgetRuns()Returns the number of runs to perform.doublegetSplitPercentage()Returns the split percentage (only train/test splits).StringglobalInfo()Returns a string describing the object.StringoutputFileTipText()Returns the tip text for this property.StringresultFileTipText()Returns the tip text for this property.StringresultFormatTipText()Returns the tip text for this property.StringrunsTipText()Returns the tip text for this property.voidsetEvaluationType(WekaExperimentGenerator.EvaluationType value)Sets the type of evaluation to perform.voidsetExperimentType(WekaExperimentGenerator.ExperimentType value)Sets the type of experiment to perform.voidsetFolds(int value)Sets the number of folds to use (only CV).voidsetOutputFile(adams.core.io.PlaceholderFile value)Sets the file to store the experiment setup in (the extensions determines the type).voidsetResultFile(adams.core.io.PlaceholderFile value)Sets the file to store the experimental results in.voidsetResultFormat(WekaExperimentGenerator.ResultFormat value)Sets the data format the results are stored in.voidsetRuns(int value)Sets the number of runs to perform.voidsetSplitPercentage(double value)Sets the split percentage (only train/test splits).StringsplitPercentageTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.sink.AbstractSink
backupState, currentInput, hasInput, input, postExecute, restoreState, wrapUp
-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, canInspectOptions, canPerformSetUpCheck, cleanUp, compareTo, configureLogger, destroy, equals, execute, finalUpdateVariables, findVariables, findVariables, forceVariables, forCommandLine, forName, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, initialize, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, preExecute, pruneBackup, pruneBackup, reset, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, stopExecution, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.flow.core.Actor
cleanUp, compareTo, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isExecuted, isFinished, isHeadless, isStopped, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, sizeOf, stopExecution, stopExecution, toCommandLine, variableChanged
-
-
-
-
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 adams.core.io.PlaceholderFile m_ResultFile
the file to store the result in.
-
m_OutputFile
protected adams.core.io.PlaceholderFile m_OutputFile
the file to store the experiment in.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.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:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.flow.core.AbstractActor
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceadams.flow.core.Actor- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Overrides:
getQuickInfoin classadams.flow.core.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(adams.core.io.PlaceholderFile value)
Sets the file to store the experimental results in.- Parameters:
value- the file
-
getResultFile
public adams.core.io.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(adams.core.io.PlaceholderFile value)
Sets the file to store the experiment setup in (the extensions determines the type).- Parameters:
value- the file
-
getOutputFile
public adams.core.io.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:
doExecutein classadams.flow.core.AbstractActor- Returns:
- null if everything is fine, otherwise error message
-
-