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

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.data.baseline.AbstractBaselineCorrection<T>
              extended by adams.data.baseline.AbstractLinearRegressionBased<T>
Type Parameters:
T - the type of data to process
All Implemented Interfaces:
CleanUpHandler, Debuggable, Destroyable, OptionHandler, ShallowCopySupporter<AbstractBaselineCorrection>, SizeOfHandler, Serializable, Comparable

public abstract class AbstractLinearRegressionBased<T extends DataContainer>
extends AbstractBaselineCorrection<T>

Abstract ancestor for linear regression based baseline correction schemes.

Version:
$Revision: 4584 $
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
AbstractBaselineCorrection.BaselineCorrectionJob<T extends DataContainer>
 
Field Summary
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_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractLinearRegressionBased()
           
 
Method Summary
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, correct, correct, correct, correct, doCorrect, equals, forCommandLine, forName, getBaselineCorrections, reset, shallowCopy, shallowCopy
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, initialize, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 class 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 OptionHandler
Overrides:
defineOptions in class 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 AbstractBaselineCorrection<T extends DataContainer>
Parameters:
data - the data to correct
Returns:
the corrected data


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.