Class CrossValidationSetup
- 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.CrossValidationSetup
-
- All Implemented Interfaces:
GlobalInfoSupporter,LoggingSupporter,SizeOfHandler,StatusMessageHandler,Stoppable,StoppableWithFeedback,Serializable
public class CrossValidationSetup extends AbstractExperimentSetup
Setup for a cross-validation experiment.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_DATASETstatic StringKEY_FOLDSstatic StringKEY_GENERATORstatic StringKEY_JOBRUNNERstatic StringKEY_RUNSprotected BaseComboBox<String>m_ComboBoxDatasetsthe datasets.protected weka.core.Instancesm_Datasetthe dataset in use.protected Filem_DatasetTmpFilethe dataset's tmp file.protected CrossValidationExperimentm_Experimentthe experiment.protected GenericObjectEditorPanelm_GOEGeneratorthe fold generator.protected GenericObjectEditorPanelm_GOEJobRunnerthe jobrunner.protected DefaultComboBoxModel<String>m_ModelDatasetsthe datasets model.protected ParameterPanelm_PanelParametersthe panel with the parameters.protected JSpinnerm_SpinnerFoldsthe number of folds.protected JSpinnerm_SpinnerRunsthe number of runs.-
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 CrossValidationSetup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(int index)Activates the specified dataset.StringcanExecute(weka.classifiers.Classifier classifier)Tests whether the experiment setup can be executed for the classifier.voiddeserialize(Map<String,Object> data, MessageCollection errors)Restores the objects.protected voiddoExecute(weka.classifiers.Classifier classifier, ResultItem item)Executes the experiment setup for the classifier and updates the result item.StringgetName()Returns the name of the evaluation (displayed in combobox).StringglobalInfo()Returns a string describing the object.ResultIteminit(weka.classifiers.Classifier classifier)Initializes the result item.protected voidinitGUI()Initializes the widgets.protected voidpostExecute(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.voidstopExecution()Stops the execution.voidupdate()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_FOLDS
public static final String KEY_FOLDS
- 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_SpinnerFolds
protected JSpinner m_SpinnerFolds
the number of folds.
-
m_GOEGenerator
protected GenericObjectEditorPanel m_GOEGenerator
the fold generator.
-
m_GOEJobRunner
protected GenericObjectEditorPanel m_GOEJobRunner
the jobrunner.
-
m_Dataset
protected weka.core.Instances m_Dataset
the dataset in use.
-
m_Experiment
protected CrossValidationExperiment 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:
initGUIin classAbstractEvaluation<ExperimentTab,ResultItem>
-
getName
public String getName()
Returns the name of the evaluation (displayed in combobox).- Specified by:
getNamein classAbstractEvaluation<ExperimentTab,ResultItem>- Returns:
- the name
-
update
public void update()
Updates the settings panel.- Specified by:
updatein classAbstractEvaluation<ExperimentTab,ResultItem>
-
activate
public void activate(int index)
Activates the specified dataset.- Specified by:
activatein 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:
canExecutein 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:
initin 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 ExceptionExecutes the experiment setup for the classifier and updates the result item.- Specified by:
doExecutein 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:
postExecutein classAbstractExperimentSetup- Parameters:
classifier- the current classifieritem- the item to update
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecutionin interfaceStoppable- Overrides:
stopExecutionin classAbstractExperimentSetup
-
serialize
public Map<String,Object> serialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Returns the objects for serialization.- Overrides:
serializein 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:
deserializein classAbstractEvaluation<ExperimentTab,ResultItem>- Parameters:
data- the data to restoreerrors- for storing errors
-
-