Package adams.data.baseline
Class AbstractLinearRegressionBased<T extends adams.data.container.DataContainer>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.baseline.AbstractBaselineCorrection<T>
-
- adams.data.baseline.AbstractLinearRegressionBased<T>
-
- 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
-
-
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.
-
Constructor Summary
Constructors Constructor Description AbstractLinearRegressionBased()
-
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
-
-
-
-
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 classadams.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 datacoeff
- 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 datacoeff
- the coefficients to use for generating the line data, the last element is the offset- Returns:
- the fake data for the line
-
-