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.SimpleBatchFilter
Performs 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 String
ATTRIBUTE_RANGE
static String
CORRECTION
protected int[]
m_AttIndices
the determined indices.protected adams.core.Range
m_AttributeRange
the range of attributes to work on.protected AbstractDetrend
m_Correction
the correction to use.protected double[]
m_WaveNo
the fake wave numbers.
-
Constructor Summary
Constructors Constructor Description SimpleDetrend()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
attributeRangeTipText()
Returns the tip text for this property.String
correctionTipText()
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.adams.core.Range
getAttributeRange()
Returns the range of attributes to detrend.weka.core.Capabilities
getCapabilities()
AbstractDetrend
getCorrection()
Returns the correction scheme to apply.protected adams.core.Range
getDefaultAttributeRange()
Returns the default regular expression for identifying the attributes to process.protected AbstractDetrend
getDefaultCorrection()
Returns the default correction scheme.String[]
getOptions()
Gets the current option settings for the OptionHandler.String
getRevision()
Returns the revision string.String
globalInfo()
Returns a string describing this filter.Enumeration
listOptions()
Returns an enumeration describing the available options.static void
main(String[] args)
Main method for testing this class.protected weka.core.Instances
process(weka.core.Instances instances)
Processes the given data (may change the provided dataset) and returns the modified version.protected void
reset()
Resets the filter.void
setAttributeRange(adams.core.Range value)
Sets the range of attributes to detrend.void
setCorrection(AbstractDetrend value)
Sets the correction scheme to apply.void
setOptions(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:
globalInfo
in 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:
listOptions
in interfaceweka.core.OptionHandler
- Overrides:
listOptions
in 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:
setOptions
in interfaceweka.core.OptionHandler
- Overrides:
setOptions
in 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:
getOptions
in interfaceweka.core.OptionHandler
- Overrides:
getOptions
in 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:
getCapabilities
in interfaceweka.core.CapabilitiesHandler
- Overrides:
getCapabilities
in classweka.filters.Filter
-
reset
protected void reset()
Resets the filter.- Overrides:
reset
in classweka.filters.SimpleFilter
-
determineOutputFormat
protected weka.core.Instances determineOutputFormat(weka.core.Instances inputFormat) throws Exception
Determines 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:
determineOutputFormat
in 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 Exception
Processes the given data (may change the provided dataset) and returns the modified version. This method is called in batchFinished().- Specified by:
process
in 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:
getRevision
in interfaceweka.core.RevisionHandler
- Overrides:
getRevision
in 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
-
-