Class FastWavelet
- java.lang.Object
-
- weka.filters.Filter
-
- weka.filters.SimpleFilter
-
- weka.filters.SimpleBatchFilter
-
- weka.filters.unsupervised.attribute.FastWavelet
-
- 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 FastWavelet extends weka.filters.SimpleBatchFilter implements weka.core.TechnicalInformationHandler, weka.filters.UnsupervisedFilterA filter for wavelet transformation using the JSci library's fast wavelet transform (FWT) algorithms.
For more information see:
(2009). JSci - A science API for Java.
BibTeX:@misc{missing_id, title = {JSci - A science API for Java}, year = {2009}, HTTP = {http://jsci.sourceforge.net/} }
Valid options are:
-D Turns on output of debugging information.
-A <HAAR|CDF2_4|DAUBECHIES2|SYMMLET8> The algorithm to use. (default: HAAR)
-P <ZERO> The padding to use. (default: ZERO)
-F <filter specification> The filter to use as preprocessing step (classname and options). (default: MultiFilter with ReplaceMissingValues and Normalize)
-inverse Whether to perform the inverse transform (from wavelet space into normal space again). (default: off)
Options specific to filter weka.filters.MultiFilter ('-F'):-D Turns on output of debugging information.
-F <classname [options]> A filter to apply (can be specified multiple times).
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intALGORITHM_CDF2_4the type of algorithm: CDF2 4.static intALGORITHM_DAUBECHIES2the type of algorithm: Daubechies2.static intALGORITHM_HAARthe type of algorithm: Haar.static intALGORITHM_SYMMLET8the type of algorithm: Symmlet8.protected intm_Algorithmthe type of algorithm.protected weka.filters.Filterm_Filteran optional filter for preprocessing of the data.protected booleanm_InverseTransformwhether to perform inverse transformation.protected intm_Paddingthe type of padding.static intPADDING_ZEROthe type of padding: Zero padding.static weka.core.Tag[]TAGS_ALGORITHMthe types of algorithm.static weka.core.Tag[]TAGS_PADDINGthe types of padding.
-
Constructor Summary
Constructors Constructor Description FastWavelet()default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringalgorithmTipText()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.StringfilterTipText()Returns the tip text for this property.weka.core.SelectedTaggetAlgorithm()Gets the type of algorithm to use.weka.core.CapabilitiesgetCapabilities()Returns the Capabilities of this filter.weka.filters.FiltergetFilter()Get the preprocessing filter.booleangetInverseTransform()Gets whether to use the inverse transform.String[]getOptions()returns the options of the current setup.weka.core.SelectedTaggetPadding()Gets the type of Padding to use.StringgetRevision()Returns the revision string.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 classifier.protected weka.core.Instancesinverse(weka.core.Instances data)Renames the attributes when using the inverse transform.StringinverseTransformTipText()Returns the tip text for this property.EnumerationlistOptions()Gets an enumeration describing the available options.static voidmain(String[] args)runs the filter with the given arguments.protected static intnextPowerOf2(int n)returns the next bigger number that's a power of 2.protected weka.core.Instancespad(weka.core.Instances data)pads the data to conform to the necessary number of attributes.StringpaddingTipText()Returns the tip text for this property.protected weka.core.Instancesprocess(weka.core.Instances instances)Processes the given data (may change the provided dataset) and returns the modified version.protected weka.core.InstancesprocessData(weka.core.Instances instances)processes the instances using the HAAR/JSci algorithm.voidsetAlgorithm(weka.core.SelectedTag value)Sets the type of algorithm to use.voidsetFilter(weka.filters.Filter value)Set the preprocessing filter (only used for setup).voidsetInverseTransform(boolean value)Sets whether to use the inverse tranform.voidsetOptions(String[] options)Parses the options for this object.voidsetPadding(weka.core.SelectedTag value)Sets the type of Padding to use.-
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
-
ALGORITHM_HAAR
public static final int ALGORITHM_HAAR
the type of algorithm: Haar.- See Also:
- Constant Field Values
-
ALGORITHM_CDF2_4
public static final int ALGORITHM_CDF2_4
the type of algorithm: CDF2 4.- See Also:
- Constant Field Values
-
ALGORITHM_DAUBECHIES2
public static final int ALGORITHM_DAUBECHIES2
the type of algorithm: Daubechies2.- See Also:
- Constant Field Values
-
ALGORITHM_SYMMLET8
public static final int ALGORITHM_SYMMLET8
the type of algorithm: Symmlet8.- See Also:
- Constant Field Values
-
TAGS_ALGORITHM
public static final weka.core.Tag[] TAGS_ALGORITHM
the types of algorithm.
-
PADDING_ZERO
public static final int PADDING_ZERO
the type of padding: Zero padding.- See Also:
- Constant Field Values
-
TAGS_PADDING
public static final weka.core.Tag[] TAGS_PADDING
the types of padding.
-
m_Filter
protected weka.filters.Filter m_Filter
an optional filter for preprocessing of the data.
-
m_Algorithm
protected int m_Algorithm
the type of algorithm.
-
m_Padding
protected int m_Padding
the type of padding.
-
m_InverseTransform
protected boolean m_InverseTransform
whether to perform inverse transformation.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing this classifier.- Specified by:
globalInfoin classweka.filters.SimpleFilter- Returns:
- a description of the classifier 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()
Gets 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.
-
getOptions
public String[] getOptions()
returns the options of the current setup.- Specified by:
getOptionsin interfaceweka.core.OptionHandler- Overrides:
getOptionsin classweka.filters.Filter- Returns:
- the current options
-
setOptions
public void setOptions(String[] options) throws Exception
Parses the options for this object.
Valid options are:
-D Turns on output of debugging information.
-A <HAAR|CDF2_4|DAUBECHIES2|SYMMLET8> The algorithm to use. (default: HAAR)
-P <ZERO> The padding to use. (default: ZERO)
-F <filter specification> The filter to use as preprocessing step (classname and options). (default: MultiFilter with ReplaceMissingValues and Normalize)
-inverse Whether to perform the inverse transform (from wavelet space into normal space again). (default: off)
Options specific to filter weka.filters.MultiFilter ('-F'):-D Turns on output of debugging information.
-F <classname [options]> A filter to apply (can be specified multiple times).
- Specified by:
setOptionsin interfaceweka.core.OptionHandler- Overrides:
setOptionsin classweka.filters.Filter- Parameters:
options- the options to use- Throws:
Exception- if the option setting fails
-
filterTipText
public String filterTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setFilter
public void setFilter(weka.filters.Filter value)
Set the preprocessing filter (only used for setup).- Parameters:
value- the preprocessing filter.
-
getFilter
public weka.filters.Filter getFilter()
Get the preprocessing filter.- Returns:
- the preprocessing filter
-
algorithmTipText
public String algorithmTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setAlgorithm
public void setAlgorithm(weka.core.SelectedTag value)
Sets the type of algorithm to use.- Parameters:
value- the algorithm type
-
getAlgorithm
public weka.core.SelectedTag getAlgorithm()
Gets the type of algorithm to use.- Returns:
- the current algorithm type.
-
paddingTipText
public String paddingTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setPadding
public void setPadding(weka.core.SelectedTag value)
Sets the type of Padding to use.- Parameters:
value- the Padding type
-
getPadding
public weka.core.SelectedTag getPadding()
Gets the type of Padding to use.- Returns:
- the current Padding type.
-
inverseTransformTipText
public String inverseTransformTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setInverseTransform
public void setInverseTransform(boolean value)
Sets whether to use the inverse tranform.- Parameters:
value- true if to use inverse transform
-
getInverseTransform
public boolean getInverseTransform()
Gets whether to use the inverse transform.- Returns:
- true if inverse transform is used
-
nextPowerOf2
protected static int nextPowerOf2(int n)
returns the next bigger number that's a power of 2. If the number is already a power of 2 then this will be returned. The number will be at least 2^2..- Parameters:
n- the number to start from- Returns:
- the next bigger number
-
pad
protected weka.core.Instances pad(weka.core.Instances data)
pads the data to conform to the necessary number of attributes.- Parameters:
data- the data to pad- Returns:
- the padded data
-
inverse
protected weka.core.Instances inverse(weka.core.Instances data)
Renames the attributes when using the inverse transform.- Parameters:
data- the data to transform.- Returns:
- the transformed data
-
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()
-
processData
protected weka.core.Instances processData(weka.core.Instances instances) throws Exceptionprocesses the instances using the HAAR/JSci algorithm.- Parameters:
instances- the data to process- Returns:
- the modified data
- Throws:
Exception- in case the processing goes wrong- See Also:
FastHaar
-
getCapabilities
public weka.core.Capabilities getCapabilities()
Returns the Capabilities of this filter.- Specified by:
getCapabilitiesin interfaceweka.core.CapabilitiesHandler- Overrides:
getCapabilitiesin classweka.filters.Filter- Returns:
- the capabilities of this object
- See Also:
Capabilities
-
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)
runs the filter with the given arguments.- Parameters:
args- the commandline arguments
-
-