Class MultiplicativeScatterCorrection

  • All Implemented Interfaces:
    Serializable, weka.core.CapabilitiesHandler, weka.core.CapabilitiesIgnorer, weka.core.CommandlineRunnable, weka.core.OptionHandler, weka.core.RevisionHandler

    public class MultiplicativeScatterCorrection
    extends weka.filters.SimpleBatchFilter
    Performs Multiplicative Scatter Correction, using the specified correction scheme.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_AttRegExp

        protected BaseRegExp m_AttRegExp
        the range of attributes to work on.
      • m_WaveNoRegExp

        protected BaseRegExp m_WaveNoRegExp
        the regexp for extracting the wavenumbers from the attribute name.
      • m_AttIndices

        protected gnu.trove.list.TIntList m_AttIndices
        the determined indices.
      • m_AttIndicesSet

        protected gnu.trove.set.TIntSet m_AttIndicesSet
        the determined indices (as set).
      • m_Average

        protected double[] m_Average
        the calculated averages.
      • m_WaveNo

        protected double[] m_WaveNo
        the extracted wave numbers.
    • Constructor Detail

      • MultiplicativeScatterCorrection

        public MultiplicativeScatterCorrection()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing this filter.
        Specified by:
        globalInfo in class weka.filters.SimpleFilter
        Returns:
        a description of the filter suitable for displaying in the explorer/experimenter gui
      • listOptions

        public Enumeration listOptions()
        Returns an enumeration describing the available options.
        Specified by:
        listOptions in interface weka.core.OptionHandler
        Overrides:
        listOptions in class weka.filters.Filter
        Returns:
        an enumeration of all the available options.
      • setOptions

        public void setOptions​(String[] options)
                        throws Exception
        Sets the OptionHandler's options using the given list. All options will be set (or reset) during this call (i.e. incremental setting of options is not possible).
        Specified by:
        setOptions in interface weka.core.OptionHandler
        Overrides:
        setOptions in class weka.filters.Filter
        Parameters:
        options - the list of options as an array of strings
        Throws:
        Exception - if an option is not supported
      • getOptions

        public String[] getOptions()
        Gets the current option settings for the OptionHandler.
        Specified by:
        getOptions in interface weka.core.OptionHandler
        Overrides:
        getOptions in class weka.filters.Filter
        Returns:
        the list of current option settings as an array of strings
      • getDefaultAttRegExp

        protected BaseRegExp getDefaultAttRegExp()
        Returns the default regular expression for identifying the attributes to process.
        Returns:
        the default
      • setAttRegExp

        public void setAttRegExp​(BaseRegExp value)
        Sets the regular expression used for identifying the attributes to process.
        Parameters:
        value - the regexp
      • getAttRegExp

        public BaseRegExp getAttRegExp()
        Returns the regular expression used for identifying the attributes to process.
        Returns:
        the regexp
      • attRegExpTipText

        public String attRegExpTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getDefaultWaveNoRegExp

        protected BaseRegExp getDefaultWaveNoRegExp()
        Returns the default regular expression for extracting the wave numbers.
        Returns:
        the default
      • setWaveNoRegExp

        public void setWaveNoRegExp​(BaseRegExp value)
        Sets the regular expression used for extracting the wave number from the attribute name (using the first group).
        Parameters:
        value - the regexp
      • getWaveNoRegExp

        public BaseRegExp getWaveNoRegExp()
        Returns the regular expression used for extracting the wave number from the attribute name (using the first group).
        Returns:
        the regexp
      • waveNoRegExpTipText

        public String waveNoRegExpTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • correctionTipText

        public String correctionTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getCapabilities

        public weka.core.Capabilities getCapabilities()
        Specified by:
        getCapabilities in interface weka.core.CapabilitiesHandler
        Overrides:
        getCapabilities in class weka.filters.Filter
      • reset

        protected void reset()
        Resets the filter.
        Overrides:
        reset in class weka.filters.SimpleFilter
      • determineOutputFormat

        protected weka.core.Instances determineOutputFormat​(weka.core.Instances inputFormat)
                                                     throws Exception
        Determines the output format based on the input format and returns this. In case the output format cannot be returned immediately, i.e., immediateOutputFormat() returns false, then this method will be called from batchFinished().
        Specified by:
        determineOutputFormat in class weka.filters.SimpleFilter
        Parameters:
        inputFormat - the input format to base the output format on
        Returns:
        the output format
        Throws:
        Exception - in case the determination goes wrong
        See Also:
        SimpleBatchFilter.hasImmediateOutputFormat(), SimpleBatchFilter.batchFinished()
      • process

        protected weka.core.Instances process​(weka.core.Instances instances)
                                       throws Exception
        Processes the given data (may change the provided dataset) and returns the modified version. This method is called in batchFinished().
        Specified by:
        process in class weka.filters.SimpleFilter
        Parameters:
        instances - the data to process
        Returns:
        the modified data
        Throws:
        Exception - in case the processing goes wrong
        See Also:
        SimpleBatchFilter.batchFinished()
      • getRevision

        public String getRevision()
        Returns the revision string.
        Specified by:
        getRevision in interface weka.core.RevisionHandler
        Overrides:
        getRevision in class weka.filters.Filter
        Returns:
        the revision
      • main

        public static void main​(String[] args)
        Main method for testing this class.
        Parameters:
        args - should contain arguments to the filter: use -h for help