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:
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
-
-
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
-
-
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, resultWriterTipText, 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
-
-
-
-
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 interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in 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:
defineOptions
in interfaceadams.core.option.OptionHandler
- 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
-
-