Package adams.data.spectrumbaseline
Class LinearRegressionBased
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.baseline.AbstractBaselineCorrection<T>
-
- adams.data.baseline.AbstractLinearRegressionBased<Spectrum>
-
- adams.data.spectrumbaseline.LinearRegressionBased
-
- 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 class LinearRegressionBased extends adams.data.baseline.AbstractLinearRegressionBased<Spectrum>
A simple linear regression based baseline correction scheme.
Fits a line through the data using linear regression and then removes this line from the data to correct the baseline.
Valid options are:
-D (property: debug) If set to true, scheme may output additional info to the console.
-ridge <double> (property: ridge) The ridge parameter for linear regression. default: 1.0E-8
- Version:
- $Revision: 2242 $
- Author:
- dale (dale at cs dot waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LinearRegressionBased()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SpectrumcorrectData(Spectrum data, double[] coeff)Corrects the data with the given coefficients.protected SpectrumgenerateLine(Spectrum data, double[] coeff)Generates fake data for the plotting the line.protected weka.core.InstancesgetInstances(Spectrum data)Returns the dataset for linear regression.-
Methods inherited from class adams.data.baseline.AbstractLinearRegressionBased
defineOptions, generateLineTipText, getGenerateLine, getRidge, globalInfo, processData, ridgeTipText, setGenerateLine, setRidge
-
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
-
getInstances
protected weka.core.Instances getInstances(Spectrum data)
Returns the dataset for linear regression.- Specified by:
getInstancesin classadams.data.baseline.AbstractLinearRegressionBased<Spectrum>- Parameters:
data- the original data- Returns:
- the data
-
correctData
protected Spectrum correctData(Spectrum data, double[] coeff)
Corrects the data with the given coefficients.- Specified by:
correctDatain classadams.data.baseline.AbstractLinearRegressionBased<Spectrum>- 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 Spectrum generateLine(Spectrum data, double[] coeff)
Generates fake data for the plotting the line.- Specified by:
generateLinein classadams.data.baseline.AbstractLinearRegressionBased<Spectrum>- 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
-
-