Class SimpleDetrend
- java.lang.Object
-
- weka.filters.Filter
-
- weka.filters.SimpleFilter
-
- weka.filters.SimpleBatchFilter
-
- weka.filters.unsupervised.attribute.SimpleDetrend
-
- All Implemented Interfaces:
Serializable,weka.core.CapabilitiesHandler,weka.core.CapabilitiesIgnorer,weka.core.CommandlineRunnable,weka.core.OptionHandler,weka.core.RevisionHandler
public class SimpleDetrend extends weka.filters.SimpleBatchFilterPerforms Detrend, using the specified correction scheme.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTRIBUTE_RANGEstatic StringCORRECTIONprotected int[]m_AttIndicesthe determined indices.protected adams.core.Rangem_AttributeRangethe range of attributes to work on.protected AbstractDetrendm_Correctionthe correction to use.protected double[]m_WaveNothe fake wave numbers.
-
Constructor Summary
Constructors Constructor Description SimpleDetrend()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringattributeRangeTipText()Returns the tip text for this property.StringcorrectionTipText()Returns the tip text for this property.protected weka.core.InstancesdetermineOutputFormat(weka.core.Instances inputFormat)Determines the output format based on the input format and returns this.adams.core.RangegetAttributeRange()Returns the range of attributes to detrend.weka.core.CapabilitiesgetCapabilities()AbstractDetrendgetCorrection()Returns the correction scheme to apply.protected adams.core.RangegetDefaultAttributeRange()Returns the default regular expression for identifying the attributes to process.protected AbstractDetrendgetDefaultCorrection()Returns the default correction scheme.String[]getOptions()Gets the current option settings for the OptionHandler.StringgetRevision()Returns the revision string.StringglobalInfo()Returns a string describing this filter.EnumerationlistOptions()Returns an enumeration describing the available options.static voidmain(String[] args)Main method for testing this class.protected weka.core.Instancesprocess(weka.core.Instances instances)Processes the given data (may change the provided dataset) and returns the modified version.protected voidreset()Resets the filter.voidsetAttributeRange(adams.core.Range value)Sets the range of attributes to detrend.voidsetCorrection(AbstractDetrend value)Sets the correction scheme to apply.voidsetOptions(String[] options)Sets the OptionHandler's options using the given list.-
Methods inherited from class weka.filters.SimpleBatchFilter
allowAccessToFullInputFormat, batchFinished, hasImmediateOutputFormat, input
-
Methods inherited from class weka.filters.Filter
batchFilterFile, bufferInput, copyValues, copyValues, debugTipText, doNotCheckCapabilitiesTipText, filterFile, flushInput, getCapabilities, getDebug, getDoNotCheckCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputFormatPeek, outputPeek, postExecution, preExecution, push, push, resetQueue, run, runFilter, setDebug, setDoNotCheckCapabilities, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper
-
-
-
-
Field Detail
-
ATTRIBUTE_RANGE
public static final String ATTRIBUTE_RANGE
- See Also:
- Constant Field Values
-
m_AttributeRange
protected adams.core.Range m_AttributeRange
the range of attributes to work on.
-
CORRECTION
public static final String CORRECTION
- See Also:
- Constant Field Values
-
m_Correction
protected AbstractDetrend m_Correction
the correction to use.
-
m_AttIndices
protected int[] m_AttIndices
the determined indices.
-
m_WaveNo
protected double[] m_WaveNo
the fake wave numbers.
-
-
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
-
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
Sets the OptionHandler's options using the given list. All options will be set (or reset) during this call (i.e. incremental setting of options is not possible).- Specified by:
setOptionsin interfaceweka.core.OptionHandler- Overrides:
setOptionsin classweka.filters.Filter- Parameters:
options- the list of options as an array of strings- Throws:
Exception- if an option is not supported
-
getOptions
public String[] getOptions()
Gets the current option settings for the OptionHandler.- Specified by:
getOptionsin interfaceweka.core.OptionHandler- Overrides:
getOptionsin classweka.filters.Filter- Returns:
- the list of current option settings as an array of strings
-
getDefaultAttributeRange
protected adams.core.Range getDefaultAttributeRange()
Returns the default regular expression for identifying the attributes to process.- Returns:
- the default
-
setAttributeRange
public void setAttributeRange(adams.core.Range value)
Sets the range of attributes to detrend.- Parameters:
value- the range
-
getAttributeRange
public adams.core.Range getAttributeRange()
Returns the range of attributes to detrend.- Returns:
- the range
-
attributeRangeTipText
public String attributeRangeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultCorrection
protected AbstractDetrend getDefaultCorrection()
Returns the default correction scheme.- Returns:
- the default
-
setCorrection
public void setCorrection(AbstractDetrend value)
Sets the correction scheme to apply.- Parameters:
value- the scheme
-
getCorrection
public AbstractDetrend getCorrection()
Returns the correction scheme to apply.- Returns:
- the scheme
-
correctionTipText
public String correctionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getCapabilities
public weka.core.Capabilities getCapabilities()
- Specified by:
getCapabilitiesin interfaceweka.core.CapabilitiesHandler- Overrides:
getCapabilitiesin classweka.filters.Filter
-
reset
protected void reset()
Resets the filter.- Overrides:
resetin classweka.filters.SimpleFilter
-
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- See Also:
SimpleBatchFilter.hasImmediateOutputFormat(),SimpleBatchFilter.batchFinished()
-
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- See Also:
SimpleBatchFilter.batchFinished()
-
getRevision
public String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceweka.core.RevisionHandler- Overrides:
getRevisionin classweka.filters.Filter- Returns:
- the revision
-
main
public static void main(String[] args)
Main method for testing this class.- Parameters:
args- should contain arguments to the filter: use -h for help
-
-