Class TrainTestSplitSetup
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.tools.wekainvestigator.evaluation.AbstractEvaluation<ExperimentTab,ResultItem>
-
- adams.gui.tools.wekainvestigator.tab.experimenttab.setup.AbstractExperimentSetup
-
- adams.gui.tools.wekainvestigator.tab.experimenttab.setup.TrainTestSplitSetup
-
- All Implemented Interfaces:
GlobalInfoSupporter
,LoggingSupporter
,SizeOfHandler
,StatusMessageHandler
,Stoppable
,StoppableWithFeedback
,Serializable
public class TrainTestSplitSetup extends AbstractExperimentSetup
Setup for a train/test-split experiment.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
KEY_DATASET
static String
KEY_GENERATOR
static String
KEY_JOBRUNNER
static String
KEY_PERCENTAGE
static String
KEY_RUNS
protected BaseCheckBox
m_CheckBoxPreserveOrder
whether to preserve the order.protected BaseComboBox<String>
m_ComboBoxDatasets
the datasets.protected weka.core.Instances
m_Dataset
the dataset in use.protected File
m_DatasetTmpFile
the dataset's tmp file.protected TrainTestSplitExperiment
m_Experiment
the experiment.protected GenericObjectEditorPanel
m_GOEGenerator
the split generator.protected GenericObjectEditorPanel
m_GOEJobRunner
the jobrunner.protected DefaultComboBoxModel<String>
m_ModelDatasets
the datasets model.protected ParameterPanel
m_PanelParameters
the panel with the parameters.protected JSpinner
m_SpinnerRuns
the number of runs.protected NumberTextField
m_TextPercentage
the split percentage.-
Fields inherited from class adams.gui.tools.wekainvestigator.tab.experimenttab.setup.AbstractExperimentSetup
m_Stopped
-
Fields inherited from class adams.gui.tools.wekainvestigator.evaluation.AbstractEvaluation
m_Owner, m_PanelOptions
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description TrainTestSplitSetup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(int index)
Activates the specified dataset.String
canExecute(weka.classifiers.Classifier classifier)
Tests whether the experiment setup can be executed for the classifier.void
deserialize(Map<String,Object> data, MessageCollection errors)
Restores the objects.protected void
doExecute(weka.classifiers.Classifier classifier, ResultItem item)
Executes the experiment setup for the classifier and updates the result item.String
getName()
Returns the name of the evaluation (displayed in combobox).String
globalInfo()
Returns a string describing the object.ResultItem
init(weka.classifiers.Classifier classifier)
Initializes the result item.protected void
initGUI()
Initializes the widgets.protected void
postExecute(weka.classifiers.Classifier classifier, ResultItem item)
Hook method for after executing the experiment, e.g., cleaning up temp files.Map<String,Object>
serialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Returns the objects for serialization.void
stopExecution()
Stops the execution.void
update()
Updates the settings panel.-
Methods inherited from class adams.gui.tools.wekainvestigator.tab.experimenttab.setup.AbstractExperimentSetup
execute, getSetups, isStopped
-
Methods inherited from class adams.gui.tools.wekainvestigator.evaluation.AbstractEvaluation
addObjectSize, addToHistory, getOwner, getPanel, getProperties, getTestingUpdateInterval, initialize, isValidDataIndex, listOrArray, setOwner, showStatus, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
KEY_DATASET
public static final String KEY_DATASET
- See Also:
- Constant Field Values
-
KEY_RUNS
public static final String KEY_RUNS
- See Also:
- Constant Field Values
-
KEY_PERCENTAGE
public static final String KEY_PERCENTAGE
- See Also:
- Constant Field Values
-
KEY_JOBRUNNER
public static final String KEY_JOBRUNNER
- See Also:
- Constant Field Values
-
KEY_GENERATOR
public static final String KEY_GENERATOR
- See Also:
- Constant Field Values
-
m_PanelParameters
protected ParameterPanel m_PanelParameters
the panel with the parameters.
-
m_ComboBoxDatasets
protected BaseComboBox<String> m_ComboBoxDatasets
the datasets.
-
m_ModelDatasets
protected DefaultComboBoxModel<String> m_ModelDatasets
the datasets model.
-
m_SpinnerRuns
protected JSpinner m_SpinnerRuns
the number of runs.
-
m_TextPercentage
protected NumberTextField m_TextPercentage
the split percentage.
-
m_CheckBoxPreserveOrder
protected BaseCheckBox m_CheckBoxPreserveOrder
whether to preserve the order.
-
m_GOEGenerator
protected GenericObjectEditorPanel m_GOEGenerator
the split generator.
-
m_GOEJobRunner
protected GenericObjectEditorPanel m_GOEJobRunner
the jobrunner.
-
m_Dataset
protected weka.core.Instances m_Dataset
the dataset in use.
-
m_Experiment
protected TrainTestSplitExperiment m_Experiment
the experiment.
-
m_DatasetTmpFile
protected File m_DatasetTmpFile
the dataset's tmp file.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Returns:
- a description suitable for displaying in the gui
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUI
in classAbstractEvaluation<ExperimentTab,ResultItem>
-
getName
public String getName()
Returns the name of the evaluation (displayed in combobox).- Specified by:
getName
in classAbstractEvaluation<ExperimentTab,ResultItem>
- Returns:
- the name
-
update
public void update()
Updates the settings panel.- Specified by:
update
in classAbstractEvaluation<ExperimentTab,ResultItem>
-
activate
public void activate(int index)
Activates the specified dataset.- Specified by:
activate
in classAbstractEvaluation<ExperimentTab,ResultItem>
- Parameters:
index
- the index of the dataset
-
canExecute
public String canExecute(weka.classifiers.Classifier classifier)
Tests whether the experiment setup can be executed for the classifier.- Specified by:
canExecute
in classAbstractExperimentSetup
- Parameters:
classifier
- the classifier to check- Returns:
- null if successful, otherwise error message
-
init
public ResultItem init(weka.classifiers.Classifier classifier) throws Exception
Initializes the result item.- Specified by:
init
in classAbstractExperimentSetup
- Parameters:
classifier
- the current classifier- Returns:
- the initialized history item
- Throws:
Exception
- if initialization fails
-
doExecute
protected void doExecute(weka.classifiers.Classifier classifier, ResultItem item) throws Exception
Executes the experiment setup for the classifier and updates the result item.- Specified by:
doExecute
in classAbstractExperimentSetup
- Parameters:
classifier
- the current classifieritem
- the item to update- Throws:
Exception
- if evaluation fails
-
postExecute
protected void postExecute(weka.classifiers.Classifier classifier, ResultItem item)
Hook method for after executing the experiment, e.g., cleaning up temp files.- Specified by:
postExecute
in classAbstractExperimentSetup
- Parameters:
classifier
- the current classifieritem
- the item to update
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecution
in interfaceStoppable
- Overrides:
stopExecution
in classAbstractExperimentSetup
-
serialize
public Map<String,Object> serialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Returns the objects for serialization.- Overrides:
serialize
in classAbstractEvaluation<ExperimentTab,ResultItem>
- Parameters:
options
- what to serialize- Returns:
- the mapping of the objects to serialize
-
deserialize
public void deserialize(Map<String,Object> data, MessageCollection errors)
Restores the objects.- Overrides:
deserialize
in classAbstractEvaluation<ExperimentTab,ResultItem>
- Parameters:
data
- the data to restoreerrors
- for storing errors
-
-