Class TrainTestSplitExperiment
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.tools.wekamultiexperimenter.experiment.AbstractExperiment
-
- adams.gui.tools.wekamultiexperimenter.experiment.TrainTestSplitExperiment
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TrainTestSplitExperiment.TrainTestSplitExperimentJob
-
Nested classes/interfaces inherited from class adams.gui.tools.wekamultiexperimenter.experiment.AbstractExperiment
AbstractExperiment.AbstractExperimentJob<T extends AbstractExperiment>
-
-
Field Summary
Fields Modifier and Type Field Description protected RandomSplitGenerator
m_Generator
the split generator to use.protected double
m_Percentage
the split percentage.protected boolean
m_PreserveOrder
whether to preserve the order.-
Fields inherited from class adams.gui.tools.wekamultiexperimenter.experiment.AbstractExperiment
m_ActualJobRunner, m_ClassAttribute, m_Classifiers, m_ClassLabelIndex, m_CommandLineHandler, m_Datasets, m_Generated, m_JobCounter, m_JobRunner, m_JobTotal, m_Notes, m_PrefixDatasetsWithIndex, m_ResetResults, m_Results, m_ResultsHandler, m_Running, m_Runs, m_StatusMessageHandler, m_Stopped, m_UseFilename
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description TrainTestSplitExperiment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected TrainTestSplitExperiment.TrainTestSplitExperimentJob
evaluate(int currentRun, weka.classifiers.Classifier cls, weka.core.Instances data)
Evaluates the classifier on the dataset.String
generatorTipText()
Returns the tip text for this property.RandomSplitGenerator
getGenerator()
Returns the scheme for generating the split.double
getPercentage()
Returns the split percentage.boolean
getPreserveOrder()
Returns whether to preserve the order.String
globalInfo()
Returns a string describing the object.String
percentageTipText()
Returns the tip text for this property.String
preserveOrderTipText()
Returns the tip text for this property.void
setGenerator(RandomSplitGenerator value)
Sets the scheme for generating the split.void
setPercentage(double value)
Sets the split percentage.void
setPreserveOrder(boolean value)
Sets whether to preserve the order.-
Methods inherited from class adams.gui.tools.wekamultiexperimenter.experiment.AbstractExperiment
addClassifier, addDataset, appendResults, classAttributeTipText, classifiersTipText, classLabelIndexTipText, clearProgress, configureRowFinder, datasetsTipText, doExecute, execute, getClassAttribute, getClassifiers, getClassLabelIndex, getDatasets, getJobRunner, getNotes, getPrefixDatasetsWithIndex, getResetResults, getResultsHandler, getRuns, getStatusMessageHandler, getUseFilename, incProgress, initExecute, initProgress, initResults, isComplete, isRequired, isStopped, jobRunnerTipText, loadDataset, locateRows, log, log, notesTipText, postExecute, preExecute, prefixDatasetsWithIndexTipText, removeIncomplete, resetResultsTipText, resultsHandlerTipText, runsTipText, setClassAttribute, setClassifiers, setClassLabelIndex, setDatasets, setJobRunner, setNotes, setPrefixDatasetsWithIndex, setResetResults, setResultsHandler, setRuns, setStatusMessageHandler, setUseFilename, shortenCommandLine, showProgress, sortResults, stopExecution, toInstances, toSpreadSheet, useFilenameTipText
-
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Percentage
protected double m_Percentage
the split percentage.
-
m_PreserveOrder
protected boolean m_PreserveOrder
whether to preserve the order.
-
m_Generator
protected RandomSplitGenerator m_Generator
the split generator to use.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- 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 interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractExperiment
-
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 classAbstractExperiment
- Parameters:
currentRun
- the current runcls
- the classifier to evaluatedata
- the dataset to evaluate on- Returns:
- null if successful, otherwise error message
-
-