Class AbstractLinearRegressionBased<T extends adams.data.container.DataContainer>

  • Type Parameters:
    T - the type of data to process
    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.ShallowCopySupporter<adams.data.baseline.AbstractBaselineCorrection>, adams.core.SizeOfHandler, Serializable, Comparable

    public abstract class AbstractLinearRegressionBased<T extends adams.data.container.DataContainer>
    extends adams.data.baseline.AbstractBaselineCorrection<T>
    Abstract ancestor for linear regression based baseline correction schemes.
    Version:
    $Revision$
    Author:
    dale (dale at cs dot waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class adams.data.baseline.AbstractBaselineCorrection

        adams.data.baseline.AbstractBaselineCorrection.BaselineCorrectionJob<T extends adams.data.container.DataContainer>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean m_GenerateLine
      whether to return the line as fake data or the corrected data.
      protected double m_Ridge
      the ridge.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract T correctData​(T data, double[] coeff)
      Corrects the data with the given coefficients.
      void defineOptions()
      Adds options to the internal list of options.
      protected abstract T generateLine​(T data, double[] coeff)
      Generates fake data for the plotting the line.
      String generateLineTipText()
      Returns the tip text for this property.
      boolean getGenerateLine()
      Returns whether to return the line as fake data or the corrected data.
      protected abstract weka.core.Instances getInstances​(T data)
      Returns a dataset containing the x and y values.
      double getRidge()
      Returns the ridge parameter.
      String globalInfo()
      Returns a string describing the object.
      protected T processData​(T data)
      Performs the actual correcting.
      String ridgeTipText()
      Returns the tip text for this property.
      void setGenerateLine​(boolean value)
      Sets whether to return the line as fake data or the corrected data.
      void setRidge​(double value)
      Sets the ridge parameter.
      • Methods inherited from class adams.data.baseline.AbstractBaselineCorrection

        checkData, cleanUp, compareTo, correct, doCorrect, equals, forCommandLine, reset, shallowCopy, shallowCopy
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_Ridge

        protected double m_Ridge
        the ridge.
      • m_GenerateLine

        protected boolean m_GenerateLine
        whether to return the line as fake data or the corrected data.
    • Constructor Detail

      • AbstractLinearRegressionBased

        public AbstractLinearRegressionBased()
    • 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 adams.core.option.AbstractOptionHandler
      • setRidge

        public void setRidge​(double value)
        Sets the ridge parameter.
        Parameters:
        value - the ridge
      • getRidge

        public double getRidge()
        Returns the ridge parameter.
        Returns:
        the ridge
      • ridgeTipText

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

        public void setGenerateLine​(boolean value)
        Sets whether to return the line as fake data or the corrected data.
        Parameters:
        value - true if debug output should be printed
      • getGenerateLine

        public boolean getGenerateLine()
        Returns whether to return the line as fake data or the corrected data.
        Returns:
        true if debugging output is on
      • generateLineTipText

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

        protected abstract weka.core.Instances getInstances​(T data)
        Returns a dataset containing the x and y values.
        Parameters:
        data - the original data
        Returns:
        the dataset for LinearRegression
      • correctData

        protected abstract T correctData​(T data,
                                         double[] coeff)
        Corrects the data with the given coefficients.
        Parameters:
        data - the original data
        coeff - the coefficients to use for correcting the data, the last element is the offset
        Returns:
        the baseline corrected data
      • generateLine

        protected abstract T generateLine​(T data,
                                          double[] coeff)
        Generates fake data for the plotting the line.
        Parameters:
        data - the original data
        coeff - the coefficients to use for generating the line data, the last element is the offset
        Returns:
        the fake data for the line
      • processData

        protected T processData​(T data)
        Performs the actual correcting.
        Specified by:
        processData in class adams.data.baseline.AbstractBaselineCorrection<T extends adams.data.container.DataContainer>
        Parameters:
        data - the data to correct
        Returns:
        the corrected data