Class AbstractExperiment.AbstractExperimentJob<T extends AbstractExperiment>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.multiprocess.AbstractJob
-
- adams.gui.tools.wekamultiexperimenter.experiment.AbstractExperiment.AbstractExperimentJob<T>
-
- Type Parameters:
T
- the type of experiment
- All Implemented Interfaces:
CleanUpHandler
,LoggingLevelHandler
,LoggingSupporter
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,Job
,Serializable
- Direct Known Subclasses:
CrossValidationExperiment.CrossValidationExperimentJob
,TrainTestSplitExperiment.TrainTestSplitExperimentJob
- Enclosing class:
- AbstractExperiment
public abstract static class AbstractExperiment.AbstractExperimentJob<T extends AbstractExperiment> extends AbstractJob
For evaluating a single classifier/dataset combination.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected weka.classifiers.Classifier
m_Classifier
the classifier.protected Index
m_ClassLabelIndex
the class label index.protected weka.core.Instances
m_Data
the dataset.protected T
m_Owner
the owner.protected SpreadSheet
m_Results
the generated results.protected int
m_Run
the run.-
Fields inherited from class adams.multiprocess.AbstractJob
m_Complete, m_ExecutionError, m_JobCompleteListener, m_JobInfo, m_ProgressInfo, m_Stopped
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractExperimentJob(T owner, int run, weka.classifiers.Classifier classifier, weka.core.Instances data)
Initializes the run.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addMetric(SpreadSheet results, String name, Object value)
Adds the metric to the results, automatically expands spreadsheet.protected void
addMetrics(SpreadSheet results, int currentRun, weka.classifiers.Classifier cls, weka.core.Instances data, weka.classifiers.Evaluation eval)
Adds the metrics from the Evaluation object to the results.protected abstract void
evaluate()
Performs the evaluation.protected String
postProcessCheck()
Checks whether all post-conditions have been met.protected String
preProcessCheck()
Checks whether all pre-conditions have been met.protected void
process()
Does the actual execution of the job.String
toString()
Returns a string representation of this job.-
Methods inherited from class adams.multiprocess.AbstractJob
cleanUp, execute, getAdditionalErrorInformation, getExecutionError, getJobCompleteListener, getJobInfo, getProgressInfo, hasExecutionError, isComplete, isStopped, jobCompleted, setJobCompleteListener, setJobInfo, setProgressInfo, stopExecution
-
Methods inherited from class adams.core.logging.CustomLoggingLevelObject
setLoggingLevel
-
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
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
-
-
-
Field Detail
-
m_Owner
protected T extends AbstractExperiment m_Owner
the owner.
-
m_Run
protected int m_Run
the run.
-
m_Classifier
protected weka.classifiers.Classifier m_Classifier
the classifier.
-
m_Data
protected weka.core.Instances m_Data
the dataset.
-
m_ClassLabelIndex
protected Index m_ClassLabelIndex
the class label index.
-
m_Results
protected SpreadSheet m_Results
the generated results.
-
-
Constructor Detail
-
AbstractExperimentJob
public AbstractExperimentJob(T owner, int run, weka.classifiers.Classifier classifier, weka.core.Instances data)
Initializes the run.- Parameters:
owner
- the owning experimentrun
- the current runclassifier
- the classifier to evaluatedata
- the data to use for evaluation
-
-
Method Detail
-
addMetric
protected void addMetric(SpreadSheet results, String name, Object value)
Adds the metric to the results, automatically expands spreadsheet.- Parameters:
results
- the results to add the metrics toname
- the namevalue
- the value
-
addMetrics
protected void addMetrics(SpreadSheet results, int currentRun, weka.classifiers.Classifier cls, weka.core.Instances data, weka.classifiers.Evaluation eval)
Adds the metrics from the Evaluation object to the results.- Parameters:
results
- the results to add the metrics tocurrentRun
- the current runcls
- the classifier to evaluatedata
- the dataset to evaluate oneval
- the Evaluation object to add
-
preProcessCheck
protected String preProcessCheck()
Checks whether all pre-conditions have been met.- Specified by:
preProcessCheck
in classAbstractJob
- Returns:
- null if everything is OK, otherwise an error message
-
evaluate
protected abstract void evaluate()
Performs the evaluation.
-
process
protected void process() throws Exception
Does the actual execution of the job.- Specified by:
process
in classAbstractJob
- Throws:
Exception
- if fails to execute job
-
postProcessCheck
protected String postProcessCheck()
Checks whether all post-conditions have been met.- Specified by:
postProcessCheck
in classAbstractJob
- Returns:
- null if everything is OK, otherwise an error message
-
toString
public String toString()
Returns a string representation of this job.- Specified by:
toString
in classAbstractJob
- Returns:
- the job as string
-
-