Package adams.data.evaluator.instance
Class IntervalEstimatorEvaluator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.evaluator.instance.AbstractEvaluator
-
- adams.data.evaluator.instance.AbstractSerializableEvaluator
-
- adams.data.evaluator.instance.IntervalEstimatorEvaluator
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SerializableObject
,adams.core.ShallowCopySupporter<Evaluator>
,adams.core.SizeOfHandler
,Evaluator
,WekaClassifierBasedEvaluator
,Serializable
,Comparable
public class IntervalEstimatorEvaluator extends AbstractSerializableEvaluator implements WekaClassifierBasedEvaluator
Stores the interval provided by the interval estimator classifier
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-missing-evaluation <float> (property: missingEvaluation) The value to use as replacement for missing evaluations. default: -999999.0
-serialization-file <adams.core.io.PlaceholderFile> (property: serializationFile) The file to serialize the generated internal model to. default: ${CWD}
-override-serialized-file <boolean> (property: overrideSerializedFile) If set to true, then any serialized file will be ignored and the setup for serialization will be regenerated. default: false
-classifier <weka.classifiers.Classifier> (property: classifier) The classifier to use (must implement weka.classifiers.IntervalEstimator ). default: weka.classifiers.functions.GaussianProcesses -L 1.0 -N 0 -K \"weka.classifiers.functions.supportVector.PolyKernel -E 1.0 -C 250007\"
-confidence-level <double> (property: confidenceLevel) The confidence level to use (0-1). default: 0.95 minimum: 0.0 maximum: 1.0
-normalize <boolean> (property: normalize) If enabled, the confidence intervals get normalized to the class range. default: false
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
LIMIT_LOWER
the lower limit.static String
LIMIT_UPPER
the upper limit.protected weka.classifiers.Classifier
m_ActualClassifier
the actual classifier in use.protected weka.classifiers.Classifier
m_Classifier
the interval estimator to use.protected double[]
m_ClassRange
the class range.protected double
m_ConfidenceLevel
the confidence level.protected weka.core.Instances
m_Header
the header.protected boolean
m_Normalize
whether to normalize.protected weka.core.Instances
m_TrainingData
the training data.-
Fields inherited from class adams.data.evaluator.instance.AbstractSerializableEvaluator
m_OverrideSerializationFile, m_SerializableObjectHelper, m_SerializationFile
-
Fields inherited from class adams.data.evaluator.instance.AbstractEvaluator
DEFAULT_METRIC, m_MissingEvaluation
-
-
Constructor Summary
Constructors Constructor Description IntervalEstimatorEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
classifierTipText()
Returns the tip text for this property.void
cleanUp()
Cleans up data structures, frees up memory.String
confidenceLevelTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.weka.classifiers.Classifier
getClassifier()
Returns the interval estimator in use.double
getConfidenceLevel()
Returns the confidence level in use.protected float
getDefaultMissingEvaluation()
Returns the default value in case of missing evaluations.boolean
getNormalize()
Returns whether to normalize the confidence intervals using the class range.String
globalInfo()
Returns a string describing the object.void
initSerializationSetup()
Regenerates all the objects that are necessary for serialization.String
normalizeTipText()
Returns the tip text for this property.protected boolean
performBuild(weka.core.Instances data)
Builds the evaluator.protected Float
performEvaluate(weka.core.Instance data)
Performs the actual evaluation.protected HashMap<String,Float>
performMultiEvaluate(weka.core.Instance data)
Performs the actual evaluation, allowing return of multiple evaluation metrics.protected double[][]
postProcess(double[][] levels)
Post-processes the confidence levels if necessary.Object[]
retrieveSerializationSetup()
Returns the member variables to serialize to a file.void
setClassifier(weka.classifiers.Classifier value)
Sets the interval estimator to use.void
setConfidenceLevel(double value)
Sets the confidence level to use.void
setNormalize(boolean value)
Sets whether to normalize the confidence intervals using the class range.void
setSerializationSetup(Object[] value)
Updates the member variables with the provided objects obtained from deserialization.-
Methods inherited from class adams.data.evaluator.instance.AbstractSerializableEvaluator
destroy, getOverrideSerializedFile, getSerializationFile, initialize, isSetupLoadedOrGenerated, overrideSerializedFileTipText, preCheck, reset, serializationFileTipText, setLoggingLevel, setOverrideSerializedFile, setSerializationFile, setSetupLoadedOrGenerated
-
Methods inherited from class adams.data.evaluator.instance.AbstractEvaluator
build, compareTo, equals, evaluate, forCommandLine, forName, getEvaluators, getMissingEvaluation, missingEvaluationTipText, preCheck, setMissingEvaluation, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface adams.data.evaluator.instance.Evaluator
build, evaluate, getMissingEvaluation, missingEvaluationTipText, setMissingEvaluation
-
-
-
-
Field Detail
-
LIMIT_LOWER
public static final String LIMIT_LOWER
the lower limit.- See Also:
- Constant Field Values
-
LIMIT_UPPER
public static final String LIMIT_UPPER
the upper limit.- See Also:
- Constant Field Values
-
m_Classifier
protected weka.classifiers.Classifier m_Classifier
the interval estimator to use.
-
m_ActualClassifier
protected weka.classifiers.Classifier m_ActualClassifier
the actual classifier in use.
-
m_ConfidenceLevel
protected double m_ConfidenceLevel
the confidence level.
-
m_Normalize
protected boolean m_Normalize
whether to normalize.
-
m_TrainingData
protected weka.core.Instances m_TrainingData
the training data.
-
m_Header
protected weka.core.Instances m_Header
the header.
-
m_ClassRange
protected double[] m_ClassRange
the class range.
-
-
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 classAbstractSerializableEvaluator
-
getDefaultMissingEvaluation
protected float getDefaultMissingEvaluation()
Returns the default value in case of missing evaluations.- Specified by:
getDefaultMissingEvaluation
in classAbstractEvaluator
- Returns:
- the default value
-
setClassifier
public void setClassifier(weka.classifiers.Classifier value)
Sets the interval estimator to use.- Specified by:
setClassifier
in interfaceWekaClassifierBasedEvaluator
- Parameters:
value
- the classifier
-
getClassifier
public weka.classifiers.Classifier getClassifier()
Returns the interval estimator in use.- Specified by:
getClassifier
in interfaceWekaClassifierBasedEvaluator
- Returns:
- the classifier
-
classifierTipText
public String classifierTipText()
Returns the tip text for this property.- Specified by:
classifierTipText
in interfaceWekaClassifierBasedEvaluator
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setConfidenceLevel
public void setConfidenceLevel(double value)
Sets the confidence level to use.- Parameters:
value
- the level (0-1)
-
getConfidenceLevel
public double getConfidenceLevel()
Returns the confidence level in use.- Returns:
- the level (0-1)
-
confidenceLevelTipText
public String confidenceLevelTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNormalize
public void setNormalize(boolean value)
Sets whether to normalize the confidence intervals using the class range.- Parameters:
value
- true if to normalize
-
getNormalize
public boolean getNormalize()
Returns whether to normalize the confidence intervals using the class range.- Returns:
- true if to normalize
-
normalizeTipText
public String normalizeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
performBuild
protected boolean performBuild(weka.core.Instances data)
Builds the evaluator.- Specified by:
performBuild
in classAbstractEvaluator
- Parameters:
data
- the instance to check- Returns:
- true if build successful
-
postProcess
protected double[][] postProcess(double[][] levels)
Post-processes the confidence levels if necessary.- Parameters:
levels
- the levels to process- Returns:
- the updated levels
-
performEvaluate
protected Float performEvaluate(weka.core.Instance data)
Performs the actual evaluation. Returns the range of the first confidence interval (upper - lower).- Overrides:
performEvaluate
in classAbstractEvaluator
- Parameters:
data
- the instance to check- Returns:
- evaluation metric,
AbstractEvaluator.m_MissingEvaluation
in case the class value is missing
-
performMultiEvaluate
protected HashMap<String,Float> performMultiEvaluate(weka.core.Instance data)
Performs the actual evaluation, allowing return of multiple evaluation metrics. Returns the lower/upper limit of the first confidence interval.- Overrides:
performMultiEvaluate
in classAbstractEvaluator
- Parameters:
data
- the instance to check- Returns:
- evaluation metrics,
AbstractEvaluator.m_MissingEvaluation
in case the class value is missing
-
initSerializationSetup
public void initSerializationSetup()
Regenerates all the objects that are necessary for serialization.- Specified by:
initSerializationSetup
in interfaceadams.core.SerializableObject
-
retrieveSerializationSetup
public Object[] retrieveSerializationSetup()
Returns the member variables to serialize to a file.- Specified by:
retrieveSerializationSetup
in interfaceadams.core.SerializableObject
- Returns:
- the objects to serialize
-
setSerializationSetup
public void setSerializationSetup(Object[] value)
Updates the member variables with the provided objects obtained from deserialization.- Specified by:
setSerializationSetup
in interfaceadams.core.SerializableObject
- Parameters:
value
- the deserialized objects
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceadams.core.CleanUpHandler
-
-