Package adams.data.evaluator.instance
Class SavitzkyGolayRange
- 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.SavitzkyGolayRange
-
- 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
,Serializable
,Comparable
public class SavitzkyGolayRange extends AbstractSerializableEvaluator
This evaluator builds three classifiers:
- on Savitzky-Golay filtered data with no derivative
- on Savitzky-Golay filtered data with first derivative
- on Savitzky-Golay filtered data with second derivative
Each instance under evaluation will be pushed through the three classifiers separately and the range of the three predictions is then output as evaluation result.
-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: NaN
-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-none <weka.classifiers.Classifier> (property: classifierNone) The classifier to be used in conjunction with Savitzky-Golay filter with no derivative. default: weka.classifiers.functions.GPD -G 0.01 -L 0.01 -N 0
-window-size-none <int> (property: windowSizeNone) The window size for the Savitzky-Golay filter with no derivative. default: 7 minimum: 3
-classifier-first <weka.classifiers.Classifier> (property: classifierFirst) The classifier to be used in conjunction with Savitzky-Golay filter with first derivative. default: weka.classifiers.functions.GPD -G 0.01 -L 0.01 -N 0
-window-size-first <int> (property: windowSizeFirst) The window size for the Savitzky-Golay filter with first derivative. default: 7 minimum: 3
-classifier-second <weka.classifiers.Classifier> (property: classifierSecond) The classifier to be used in conjunction with Savitzky-Golay filter with second derivative. default: weka.classifiers.functions.GPD -G 0.01 -L 0.01 -N 0
-window-size-second <int> (property: windowSizeSecond) The window size for the Savitzky-Golay filter with second derivative. default: 7 minimum: 3
-normalize <boolean> (property: normalize) If enabled, the predictions get normalized to the range of the class attribute. default: false
- Version:
- $Revision: 2242 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SpectrumClassifier
m_ActualClassifierFirst
the actual classifier in use for first derivative.protected SpectrumClassifier
m_ActualClassifierNone
the actual classifier in use for no derivative.protected SpectrumClassifier
m_ActualClassifierSecond
the actual classifier in use for second derivative.protected weka.classifiers.Classifier
m_ClassifierFirst
the classifier to be used on SG data with first derivative.protected weka.classifiers.Classifier
m_ClassifierNone
the classifier to be used on SG data with no derivative.protected weka.classifiers.Classifier
m_ClassifierSecond
the classifier to be used on SG data with second derivative.protected weka.core.AttributeStats
m_ClassStats
the class attribute stats.protected weka.core.Instances
m_Header
the header of the training data.protected boolean
m_Normalize
whether to normalize the predictions to the class attribute range.protected weka.core.Instances
m_TrainingData
the training data.protected int
m_WindowSizeFirst
the window size for for SG with first derivative.protected int
m_WindowSizeNone
the window size for for SG with no derivative.protected int
m_WindowSizeSecond
the window size for for SG with second derivative.-
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 SavitzkyGolayRange()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
classifierFirstTipText()
Returns the tip text for this property.String
classifierNoneTipText()
Returns the tip text for this property.String
classifierSecondTipText()
Returns the tip text for this property.void
cleanUp()
Cleans up data structures, frees up memory.void
defineOptions()
Adds options to the internal list of options.weka.classifiers.Classifier
getClassifierFirst()
Returns the classifier to be used in conjunction with Savitzky-Golay filter with first derivative.weka.classifiers.Classifier
getClassifierNone()
Returns the classifier to be used in conjunction with Savitzky-Golay filter with no derivative.weka.classifiers.Classifier
getClassifierSecond()
Returns the classifier to be used in conjunction with Savitzky-Golay filter with second derivative.protected weka.classifiers.Classifier
getDefaultClassifier(int derivative)
Returns the default classifier for the specified derivative.protected float
getDefaultMissingEvaluation()
Returns the default value in case of missing evaluations.boolean
getNormalize()
Returns whether to normalize the predictions to the class attribute range.int
getWindowSizeFirst()
Returns the Savitzky-Golay window size for filter with first derivative.int
getWindowSizeNone()
Returns the Savitzky-Golay window size for filter with no derivative.int
getWindowSizeSecond()
Returns the Savitzky-Golay window size for filter with second derivative.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.Object[]
retrieveSerializationSetup()
Returns the member variables to serialize to a file.void
setClassifierFirst(weka.classifiers.Classifier value)
Sets the classifier to be used in conjunction with Savitzky-Golay filter with first derivative.void
setClassifierNone(weka.classifiers.Classifier value)
Sets the classifier to be used in conjunction with Savitzky-Golay filter with no derivative.void
setClassifierSecond(weka.classifiers.Classifier value)
Sets the classifier to be used in conjunction with Savitzky-Golay filter with second derivative.void
setNormalize(boolean value)
Sets whether to normalize the predictions to the class attribute range.void
setSerializationSetup(Object[] value)
Updates the member variables with the provided objects obtained from deserialization.void
setWindowSizeFirst(int value)
Sets the Savitzky-Golay window size for filter with first derivative.void
setWindowSizeNone(int value)
Sets the Savitzky-Golay window size for filter with no derivative.void
setWindowSizeSecond(int value)
Sets the Savitzky-Golay window size for filter with second derivative.String
windowSizeFirstTipText()
Returns the tip text for this property.String
windowSizeNoneTipText()
Returns the tip text for this property.String
windowSizeSecondTipText()
Returns the tip text for this property.-
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, performMultiEvaluate, 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
-
-
-
-
Field Detail
-
m_ClassifierNone
protected weka.classifiers.Classifier m_ClassifierNone
the classifier to be used on SG data with no derivative.
-
m_WindowSizeNone
protected int m_WindowSizeNone
the window size for for SG with no derivative.
-
m_ActualClassifierNone
protected SpectrumClassifier m_ActualClassifierNone
the actual classifier in use for no derivative.
-
m_ClassifierFirst
protected weka.classifiers.Classifier m_ClassifierFirst
the classifier to be used on SG data with first derivative.
-
m_WindowSizeFirst
protected int m_WindowSizeFirst
the window size for for SG with first derivative.
-
m_ActualClassifierFirst
protected SpectrumClassifier m_ActualClassifierFirst
the actual classifier in use for first derivative.
-
m_ClassifierSecond
protected weka.classifiers.Classifier m_ClassifierSecond
the classifier to be used on SG data with second derivative.
-
m_WindowSizeSecond
protected int m_WindowSizeSecond
the window size for for SG with second derivative.
-
m_ActualClassifierSecond
protected SpectrumClassifier m_ActualClassifierSecond
the actual classifier in use for second derivative.
-
m_Normalize
protected boolean m_Normalize
whether to normalize the predictions to the class attribute range.
-
m_TrainingData
protected weka.core.Instances m_TrainingData
the training data.
-
m_Header
protected weka.core.Instances m_Header
the header of the training data.
-
m_ClassStats
protected weka.core.AttributeStats m_ClassStats
the class attribute stats.
-
-
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
-
getDefaultClassifier
protected weka.classifiers.Classifier getDefaultClassifier(int derivative)
Returns the default classifier for the specified derivative.- Parameters:
derivative
- the derivative- Returns:
- the classifier setup
-
setClassifierNone
public void setClassifierNone(weka.classifiers.Classifier value)
Sets the classifier to be used in conjunction with Savitzky-Golay filter with no derivative.- Parameters:
value
- the classifier
-
getClassifierNone
public weka.classifiers.Classifier getClassifierNone()
Returns the classifier to be used in conjunction with Savitzky-Golay filter with no derivative.- Returns:
- the classifier
-
classifierNoneTipText
public String classifierNoneTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setWindowSizeNone
public void setWindowSizeNone(int value)
Sets the Savitzky-Golay window size for filter with no derivative.- Parameters:
value
- the window size
-
getWindowSizeNone
public int getWindowSizeNone()
Returns the Savitzky-Golay window size for filter with no derivative.- Returns:
- the window size
-
windowSizeNoneTipText
public String windowSizeNoneTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setClassifierFirst
public void setClassifierFirst(weka.classifiers.Classifier value)
Sets the classifier to be used in conjunction with Savitzky-Golay filter with first derivative.- Parameters:
value
- the classifier
-
getClassifierFirst
public weka.classifiers.Classifier getClassifierFirst()
Returns the classifier to be used in conjunction with Savitzky-Golay filter with first derivative.- Returns:
- the classifier
-
classifierFirstTipText
public String classifierFirstTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setWindowSizeFirst
public void setWindowSizeFirst(int value)
Sets the Savitzky-Golay window size for filter with first derivative.- Parameters:
value
- the window size
-
getWindowSizeFirst
public int getWindowSizeFirst()
Returns the Savitzky-Golay window size for filter with first derivative.- Returns:
- the window size
-
windowSizeFirstTipText
public String windowSizeFirstTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setClassifierSecond
public void setClassifierSecond(weka.classifiers.Classifier value)
Sets the classifier to be used in conjunction with Savitzky-Golay filter with second derivative.- Parameters:
value
- the classifier
-
getClassifierSecond
public weka.classifiers.Classifier getClassifierSecond()
Returns the classifier to be used in conjunction with Savitzky-Golay filter with second derivative.- Returns:
- the classifier
-
classifierSecondTipText
public String classifierSecondTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setWindowSizeSecond
public void setWindowSizeSecond(int value)
Sets the Savitzky-Golay window size for filter with second derivative.- Parameters:
value
- the window size
-
getWindowSizeSecond
public int getWindowSizeSecond()
Returns the Savitzky-Golay window size for filter with second derivative.- Returns:
- the window size
-
windowSizeSecondTipText
public String windowSizeSecondTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setNormalize
public void setNormalize(boolean value)
Sets whether to normalize the predictions to the class attribute range.- Parameters:
value
- true if to normalize
-
getNormalize
public boolean getNormalize()
Returns whether to normalize the predictions to the class attribute 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 explorer/experimenter gui
-
getDefaultMissingEvaluation
protected float getDefaultMissingEvaluation()
Returns the default value in case of missing evaluations.- Specified by:
getDefaultMissingEvaluation
in classAbstractEvaluator
- Returns:
- the default value
-
performEvaluate
protected Float performEvaluate(weka.core.Instance data)
Performs the actual evaluation.- Overrides:
performEvaluate
in classAbstractEvaluator
- Parameters:
data
- the instance to check- Returns:
- always 1.0
-
performBuild
protected boolean performBuild(weka.core.Instances data)
Builds the evaluator.- Specified by:
performBuild
in classAbstractEvaluator
- Parameters:
data
- the instance to check- Returns:
- always true
-
initSerializationSetup
public void initSerializationSetup()
Regenerates all the objects that are necessary for serialization.
-
retrieveSerializationSetup
public Object[] retrieveSerializationSetup()
Returns the member variables to serialize to a file.- Returns:
- the objects to serialize
-
setSerializationSetup
public void setSerializationSetup(Object[] value)
Updates the member variables with the provided objects obtained from deserialization.- Parameters:
value
- the deserialized objects
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.
-
-