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 classTrainTestSplitExperiment.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 RandomSplitGeneratorm_Generatorthe split generator to use.protected doublem_Percentagethe split percentage.protected booleanm_PreserveOrderwhether 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 voiddefineOptions()Adds options to the internal list of options.protected TrainTestSplitExperiment.TrainTestSplitExperimentJobevaluate(int currentRun, weka.classifiers.Classifier cls, weka.core.Instances data)Evaluates the classifier on the dataset.StringgeneratorTipText()Returns the tip text for this property.RandomSplitGeneratorgetGenerator()Returns the scheme for generating the split.doublegetPercentage()Returns the split percentage.booleangetPreserveOrder()Returns whether to preserve the order.StringglobalInfo()Returns a string describing the object.StringpercentageTipText()Returns the tip text for this property.StringpreserveOrderTipText()Returns the tip text for this property.voidsetGenerator(RandomSplitGenerator value)Sets the scheme for generating the split.voidsetPercentage(double value)Sets the split percentage.voidsetPreserveOrder(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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
evaluatein classAbstractExperiment- Parameters:
currentRun- the current runcls- the classifier to evaluatedata- the dataset to evaluate on- Returns:
- null if successful, otherwise error message
-
-