Class Detrend
- java.lang.Object
-
- weka.filters.Filter
-
- weka.filters.SimpleFilter
-
- weka.filters.SimpleBatchFilter
-
- weka.filters.unsupervised.attribute.Detrend
-
- All Implemented Interfaces:
Serializable,weka.core.CapabilitiesHandler,weka.core.CapabilitiesIgnorer,weka.core.CommandlineRunnable,weka.core.OptionHandler,weka.core.RevisionHandler
public class Detrend 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 StringATT_REGEXPstatic StringCORRECTIONprotected gnu.trove.list.TIntListm_AttIndicesthe determined indices.protected gnu.trove.set.TIntSetm_AttIndicesSetthe determined indices (as set).protected adams.core.base.BaseRegExpm_AttRegExpthe range of attributes to work on.protected AbstractDetrendm_Correctionthe correction to use.protected double[]m_WaveNothe extracted wave numbers.protected adams.core.base.BaseRegExpm_WaveNoRegExpthe regexp for extracting the wavenumbers from the attribute name.static StringWAVENO_REGEXP
-
Constructor Summary
Constructors Constructor Description Detrend()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringattRegExpTipText()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.base.BaseRegExpgetAttRegExp()Returns the regular expression used for identifying the attributes to process.weka.core.CapabilitiesgetCapabilities()AbstractDetrendgetCorrection()Returns the correction scheme to apply.protected adams.core.base.BaseRegExpgetDefaultAttRegExp()Returns the default regular expression for identifying the attributes to process.protected AbstractDetrendgetDefaultCorrection()Returns the default correction scheme.protected adams.core.base.BaseRegExpgetDefaultWaveNoRegExp()Returns the default regular expression for extracting the wave numbers.String[]getOptions()Gets the current option settings for the OptionHandler.StringgetRevision()Returns the revision string.adams.core.base.BaseRegExpgetWaveNoRegExp()Returns the regular expression used for extracting the wave number from the attribute name (using the first group).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.voidsetAttRegExp(adams.core.base.BaseRegExp value)Sets the regular expression used for identifying the attributes to process.voidsetCorrection(AbstractDetrend value)Sets the correction scheme to apply.voidsetOptions(String[] options)Sets the OptionHandler's options using the given list.voidsetWaveNoRegExp(adams.core.base.BaseRegExp value)Sets the regular expression used for extracting the wave number from the attribute name (using the first group).StringwaveNoRegExpTipText()Returns the tip text for this property.-
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
-
ATT_REGEXP
public static final String ATT_REGEXP
- See Also:
- Constant Field Values
-
m_AttRegExp
protected adams.core.base.BaseRegExp m_AttRegExp
the range of attributes to work on.
-
WAVENO_REGEXP
public static final String WAVENO_REGEXP
- See Also:
- Constant Field Values
-
m_WaveNoRegExp
protected adams.core.base.BaseRegExp m_WaveNoRegExp
the regexp for extracting the wavenumbers from the attribute name.
-
CORRECTION
public static final String CORRECTION
- See Also:
- Constant Field Values
-
m_Correction
protected AbstractDetrend m_Correction
the correction to use.
-
m_AttIndices
protected gnu.trove.list.TIntList m_AttIndices
the determined indices.
-
m_AttIndicesSet
protected gnu.trove.set.TIntSet m_AttIndicesSet
the determined indices (as set).
-
m_WaveNo
protected double[] m_WaveNo
the extracted 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
-
getDefaultAttRegExp
protected adams.core.base.BaseRegExp getDefaultAttRegExp()
Returns the default regular expression for identifying the attributes to process.- Returns:
- the default
-
setAttRegExp
public void setAttRegExp(adams.core.base.BaseRegExp value)
Sets the regular expression used for identifying the attributes to process.- Parameters:
value- the regexp
-
getAttRegExp
public adams.core.base.BaseRegExp getAttRegExp()
Returns the regular expression used for identifying the attributes to process.- Returns:
- the regexp
-
attRegExpTipText
public String attRegExpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultWaveNoRegExp
protected adams.core.base.BaseRegExp getDefaultWaveNoRegExp()
Returns the default regular expression for extracting the wave numbers.- Returns:
- the default
-
setWaveNoRegExp
public void setWaveNoRegExp(adams.core.base.BaseRegExp value)
Sets the regular expression used for extracting the wave number from the attribute name (using the first group).- Parameters:
value- the regexp
-
getWaveNoRegExp
public adams.core.base.BaseRegExp getWaveNoRegExp()
Returns the regular expression used for extracting the wave number from the attribute name (using the first group).- Returns:
- the regexp
-
waveNoRegExpTipText
public String waveNoRegExpTipText()
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
-
-