|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.filters.Filter
weka.filters.SimpleFilter
weka.filters.SimpleStreamFilter
weka.filters.unsupervised.attribute.SavitzkyGolay
public class SavitzkyGolay
A filter that applies Savitzky-Golay smoothing.
If a class attribute is present this will not be touched and moved to the end.
For more information see:
A. Savitzky, Marcel J.E. Golay (1964). Smoothing and Differentiation of Data by Simplified Least Squares Procedures. Analytical Chemistry. 36:1627-1639.
William H. Press, Saul A. Teukolsky, William T. Vetterling, Brian P. Flannery (1992). Savitzky-Golay Smoothing Filters.
@article{Savitzky1964,
author = {A. Savitzky and Marcel J.E. Golay},
journal = {Analytical Chemistry},
pages = {1627-1639},
title = {Smoothing and Differentiation of Data by Simplified Least Squares Procedures},
volume = {36},
year = {1964},
HTTP = {http://dx.doi.org/10.1021/ac60214a047}
}
@inbook{Press1992,
author = {William H. Press and Saul A. Teukolsky and William T. Vetterling and Brian P. Flannery},
chapter = {14.8},
edition = {Second},
pages = {650-655},
publisher = {Cambridge University Press},
series = {Numerical Recipes in C},
title = {Savitzky-Golay Smoothing Filters},
year = {1992},
PDF = {http://www.nrbook.com/a/bookcpdf/c14-8.pdf}
}
Valid options are:
-left <int> The number of points to the left (>= 0). (default: 3)
-right <int> The number of points to the right (>= 0). (default: 3)
-polynomial <int> The polynomial order (>= 2). (default: 2)
-derivative <int> The order of the derivative (>= 0). (default: 1)
| Field Summary | |
|---|---|
protected double[] |
m_Coefficients
the calculated coefficients. |
protected int |
m_DerivativeOrder
the order of the derivative. |
protected int |
m_NumPointsLeft
the number of points to the left of a data point. |
protected int |
m_NumPointsRight
the number of points to the right of a data point. |
protected int |
m_PolynomialOrder
the polynomial order. |
| Fields inherited from class weka.filters.SimpleFilter |
|---|
m_Debug |
| Fields inherited from class weka.filters.Filter |
|---|
m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts |
| Constructor Summary | |
|---|---|
SavitzkyGolay()
|
|
| Method Summary | |
|---|---|
String |
derivativeOrderTipText()
Returns the tip text for this property. |
protected weka.core.Instances |
determineOutputFormat(weka.core.Instances inputFormat)
Determines the output format based on the input format and returns this. |
weka.core.Capabilities |
getCapabilities()
Returns the Capabilities of this filter. |
int |
getDerivativeOrder()
Returns the order of the derivative. |
int |
getNumPointsLeft()
Returns the number of points to the left of a data point. |
int |
getNumPointsRight()
Returns the number of points to the right of a data point. |
String[] |
getOptions()
Gets the current settings of the filter. |
int |
getPolynomialOrder()
Returns the polynominal order. |
String |
getRevision()
Returns the revision string. |
weka.core.TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on. |
String |
globalInfo()
Returns a string describing this classifier. |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(String[] args)
Main method for testing this class. |
String |
numPointsLeftTipText()
Returns the tip text for this property. |
String |
numPointsRightTipText()
Returns the tip text for this property. |
String |
polynomialOrderTipText()
Returns the tip text for this property. |
protected weka.core.Instance |
process(weka.core.Instance instance)
processes the given instance (may change the provided instance) and returns the modified version. |
protected void |
reset()
Resets the filter. |
void |
setDerivativeOrder(int value)
Sets the order of the derivative. |
void |
setNumPointsLeft(int value)
Sets the number of points to the left of a data point. |
void |
setNumPointsRight(int value)
Sets the number of points to the right of a data point. |
void |
setOptions(String[] options)
Parses a list of options for this object. |
void |
setPolynomialOrder(int value)
Sets the polynomial order. |
| Methods inherited from class weka.filters.SimpleStreamFilter |
|---|
batchFinished, hasImmediateOutputFormat, input, preprocess, process |
| Methods inherited from class weka.filters.SimpleFilter |
|---|
debugTipText, getDebug, setDebug, setInputFormat |
| Methods inherited from class weka.filters.Filter |
|---|
batchFilterFile, bufferInput, copyValues, copyValues, filterFile, flushInput, getCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputFormatPeek, outputPeek, push, resetQueue, runFilter, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int m_PolynomialOrder
protected int m_DerivativeOrder
protected int m_NumPointsLeft
protected int m_NumPointsRight
protected double[] m_Coefficients
| Constructor Detail |
|---|
public SavitzkyGolay()
| Method Detail |
|---|
public String globalInfo()
globalInfo in class weka.filters.SimpleFilterpublic weka.core.TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface weka.core.TechnicalInformationHandlerpublic Enumeration listOptions()
listOptions in interface weka.core.OptionHandlerlistOptions in class weka.filters.SimpleFilter
public void setOptions(String[] options)
throws Exception
setOptions in interface weka.core.OptionHandlersetOptions in class weka.filters.SimpleFilteroptions - the list of options as an array of strings
Exception - if an option is not supportedreset()public String[] getOptions()
getOptions in interface weka.core.OptionHandlergetOptions in class weka.filters.SimpleFilterprotected void reset()
reset in class weka.filters.SimpleFilterpublic void setPolynomialOrder(int value)
value - the orderpublic int getPolynomialOrder()
public String polynomialOrderTipText()
public void setDerivativeOrder(int value)
value - the orderpublic int getDerivativeOrder()
public String derivativeOrderTipText()
public void setNumPointsLeft(int value)
value - the number of pointspublic int getNumPointsLeft()
public String numPointsLeftTipText()
public void setNumPointsRight(int value)
value - the number of pointspublic int getNumPointsRight()
public String numPointsRightTipText()
public weka.core.Capabilities getCapabilities()
getCapabilities in interface weka.core.CapabilitiesHandlergetCapabilities in class weka.filters.FilterCapabilities
protected weka.core.Instances determineOutputFormat(weka.core.Instances inputFormat)
throws Exception
determineOutputFormat in class weka.filters.SimpleStreamFilterinputFormat - the input format to base the output format on
Exception - in case the determination goes wrong
protected weka.core.Instance process(weka.core.Instance instance)
throws Exception
process in class weka.filters.SimpleStreamFilterinstance - the instance to process
Exception - in case the processing goes wrongpublic String getRevision()
getRevision in interface weka.core.RevisionHandlergetRevision in class weka.filters.Filterpublic static void main(String[] args)
args - should contain arguments to the filter: use -h for help
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||