Class 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 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.
    • Constructor Detail

      • SavitzkyGolayRange

        public SavitzkyGolayRange()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.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 interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class AbstractSerializableEvaluator
      • 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 class AbstractEvaluator
        Returns:
        the default value
      • performEvaluate

        protected Float performEvaluate​(weka.core.Instance data)
        Performs the actual evaluation.
        Overrides:
        performEvaluate in class AbstractEvaluator
        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 class AbstractEvaluator
        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.