Package adams.data.baseline
Class AbstractLinearRegressionBased<T extends 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:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,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$
- 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
Fields Modifier and Type Field Description protected booleanm_GenerateLinewhether to return the line as fake data or the corrected data.protected doublem_Ridgethe 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
-
-
Constructor Summary
Constructors Constructor Description AbstractLinearRegressionBased()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract TcorrectData(T data, double[] coeff)Corrects the data with the given coefficients.voiddefineOptions()Adds options to the internal list of options.protected abstract TgenerateLine(T data, double[] coeff)Generates fake data for the plotting the line.StringgenerateLineTipText()Returns the tip text for this property.booleangetGenerateLine()Returns whether to return the line as fake data or the corrected data.protected abstract weka.core.InstancesgetInstances(T data)Returns a dataset containing the x and y values.doublegetRidge()Returns the ridge parameter.StringglobalInfo()Returns a string describing the object.protected TprocessData(T data)Performs the actual correcting.StringridgeTipText()Returns the tip text for this property.voidsetGenerateLine(boolean value)Sets whether to return the line as fake data or the corrected data.voidsetRidge(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 class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
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
-
processData
protected T processData(T data)
Performs the actual correcting.- Specified by:
processDatain classAbstractBaselineCorrection<T extends DataContainer>- Parameters:
data- the data to correct- Returns:
- the corrected data
-
-