Class RangeBasedSavitzkyGolay
- java.lang.Object
-
- weka.filters.Filter
-
- weka.filters.SimpleFilter
-
- weka.filters.SimpleBatchFilter
-
- weka.filters.unsupervised.attribute.RangeBasedSavitzkyGolay
-
- All Implemented Interfaces:
Serializable,weka.core.CapabilitiesHandler,weka.core.CapabilitiesIgnorer,weka.core.CommandlineRunnable,weka.core.OptionHandler,weka.core.RevisionHandler,weka.core.TechnicalInformationHandler,weka.filters.UnsupervisedFilter
public class RangeBasedSavitzkyGolay extends weka.filters.SimpleBatchFilter implements weka.core.TechnicalInformationHandler, weka.filters.UnsupervisedFilterConfigures a weka.filters.unsupervised.attribute.PartitionedMultiFilter, using the supplied ranges and the number of points to configure the weka.filters.unsupervised.attribute.SavitzkyGolay2 filter to apply to that subset. BibTeX:@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:-range <weka.filters.unsupervised.attribute.SavitzkyGolayRange + options> The range definition(s) (can be specified multiple times). (default: none)
-U Flag for leaving unused attributes out of the output, by default these are included in the filter output.
-output-debug-info If set, filter is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, filter capabilities are not checked before filter is built (use with caution).
- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SpectrumFilterm_Filterthe filter used internally.protected weka.core.Instancesm_FirstPassDatathe filteed data from the first pass.protected SavitzkyGolayRange[]m_Rangesthe ranges to use.protected booleanm_RemoveUnusedWhether unused attributes are left out of the output.static StringPREFIX_AMPLITUDEthe prefix for a spectral attribute.
-
Constructor Summary
Constructors Constructor Description RangeBasedSavitzkyGolay()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowAccessToFullInputFormat()protected weka.core.InstancesdetermineOutputFormat(weka.core.Instances inputFormat)Determines the output format based on the input format and returns this.String[]getOptions()Gets the current settings of the filter.SavitzkyGolayRange[]getRanges()Returns the ranges to use.booleangetRemoveUnused()Gets whether unused attributes (ones that are not covered by any of the ranges) are removed from the output.weka.core.TechnicalInformationgetTechnicalInformation()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.StringglobalInfo()Returns a string describing this filter.EnumerationlistOptions()Returns an enumeration describing the available options.protected weka.core.Instancesprocess(weka.core.Instances instances)Processes the given data (may change the provided dataset) and returns the modified version.StringrangesTipText()Returns the tip text for this property.StringremoveUnusedTipText()Returns the tip text for this property.protected voidreset()resets the filter, i.e., m_NewBatch to true and m_FirstBatchDone to false.voidsetOptions(String[] options)Parses a list of options for this object.voidsetRanges(SavitzkyGolayRange[] value)Sets the ranges to use.voidsetRemoveUnused(boolean value)Sets whether unused attributes (ones that are not covered by any of the ranges) are removed from the output.-
Methods inherited from class weka.filters.SimpleBatchFilter
batchFinished, hasImmediateOutputFormat, input
-
Methods inherited from class weka.filters.Filter
batchFilterFile, bufferInput, copyValues, copyValues, debugTipText, doNotCheckCapabilitiesTipText, filterFile, flushInput, getCapabilities, getCapabilities, getDebug, getDoNotCheckCapabilities, getInputFormat, getOutputFormat, getRevision, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, main, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputFormatPeek, outputPeek, postExecution, preExecution, push, push, resetQueue, run, runFilter, setDebug, setDoNotCheckCapabilities, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper
-
-
-
-
Field Detail
-
PREFIX_AMPLITUDE
public static final String PREFIX_AMPLITUDE
the prefix for a spectral attribute.- See Also:
- Constant Field Values
-
m_Ranges
protected SavitzkyGolayRange[] m_Ranges
the ranges to use.
-
m_RemoveUnused
protected boolean m_RemoveUnused
Whether unused attributes are left out of the output.
-
m_Filter
protected SpectrumFilter m_Filter
the filter used internally.
-
m_FirstPassData
protected weka.core.Instances m_FirstPassData
the filteed data from the first pass.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing this filter.- Specified by:
globalInfoin classweka.filters.SimpleFilter- Returns:
- a description of the filter suitable for displaying in the explorer/experimenter gui
-
getTechnicalInformation
public 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.- Specified by:
getTechnicalInformationin interfaceweka.core.TechnicalInformationHandler- Returns:
- the technical information about this class
-
listOptions
public Enumeration listOptions()
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceweka.core.OptionHandler- Overrides:
listOptionsin classweka.filters.Filter- Returns:
- an enumeration of all the available options.
-
setOptions
public void setOptions(String[] options) throws Exception
Parses a list of options for this object. Also resets the state of the filter (this reset doesn't affect the options).
-
getOptions
public String[] getOptions()
Gets the current settings of the filter.- Specified by:
getOptionsin interfaceweka.core.OptionHandler- Overrides:
getOptionsin classweka.filters.Filter- Returns:
- an array of strings suitable for passing to setOptions
-
setRanges
public void setRanges(SavitzkyGolayRange[] value)
Sets the ranges to use.- Parameters:
value- the ranges
-
getRanges
public SavitzkyGolayRange[] getRanges()
Returns the ranges to use.- Returns:
- the ranges
-
rangesTipText
public String rangesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRemoveUnused
public void setRemoveUnused(boolean value)
Sets whether unused attributes (ones that are not covered by any of the ranges) are removed from the output.- Parameters:
value- if true then the unused attributes get removed
-
getRemoveUnused
public boolean getRemoveUnused()
Gets whether unused attributes (ones that are not covered by any of the ranges) are removed from the output.- Returns:
- true if unused attributes are removed
-
removeUnusedTipText
public String removeUnusedTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
reset
protected void reset()
resets the filter, i.e., m_NewBatch to true and m_FirstBatchDone to false.- Overrides:
resetin classweka.filters.SimpleFilter
-
allowAccessToFullInputFormat
public boolean allowAccessToFullInputFormat()
- Overrides:
allowAccessToFullInputFormatin classweka.filters.SimpleBatchFilter
-
determineOutputFormat
protected weka.core.Instances determineOutputFormat(weka.core.Instances inputFormat) throws ExceptionDetermines the output format based on the input format and returns this. In case the output format cannot be returned immediately, i.e., immediateOutputFormat() returns false, then this method will be called from batchFinished().- Specified by:
determineOutputFormatin classweka.filters.SimpleFilter- Parameters:
inputFormat- the input format to base the output format on- Returns:
- the output format
- Throws:
Exception- in case the determination goes wrong
-
process
protected weka.core.Instances process(weka.core.Instances instances) throws ExceptionProcesses the given data (may change the provided dataset) and returns the modified version. This method is called in batchFinished().- Specified by:
processin classweka.filters.SimpleFilter- Parameters:
instances- the data to process- Returns:
- the modified data
- Throws:
Exception- in case the processing goes wrong
-
-