Package weka.filters
Class FilteredFilter
- java.lang.Object
-
- weka.filters.Filter
-
- weka.filters.SimpleFilter
-
- weka.filters.SimpleBatchFilter
-
- weka.filters.FilteredFilter
-
- All Implemented Interfaces:
Serializable,weka.core.CapabilitiesHandler,weka.core.CapabilitiesIgnorer,weka.core.CommandlineRunnable,weka.core.OptionHandler,weka.core.RevisionHandler
public class FilteredFilter extends weka.filters.SimpleBatchFilterFirst applies the pre-filter to the data and the generated data is fed into the main filter.
Valid options are:-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).
-pre <filter specification> Full class name of pre-filter to use, followed by scheme options. (default: weka.filters.unsupervised.instance.DatasetCleaner)
-main <filter specification> Full class name of main filter to use, followed by scheme options. (default: weka.filters.supervised.attribute.PLS)
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected weka.filters.Filterm_MainFilterThe main filter to apply to the data.protected weka.filters.Filterm_PreFilterThe pre-filter to apply to the data.
-
Constructor Summary
Constructors Constructor Description FilteredFilter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowAccessToFullInputFormat()Returns whether to allow the determineOutputFormat(Instances) method access to the full dataset rather than just the header.protected weka.core.InstancesdetermineOutputFormat(weka.core.Instances inputFormat)Determines the output format based on the input format and returns this.weka.core.CapabilitiesgetCapabilities()Returns the Capabilities of this filter.protected weka.filters.FiltergetDefaultMainFilter()Returns the default main filter.protected weka.filters.FiltergetDefaultPreFilter()Returns the default pre-filter.weka.filters.FiltergetMainFilter()Returns the main filter in use.String[]getOptions()Gets the current settings of the classifier.weka.filters.FiltergetPreFilter()Returns the pre-filter in use.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 running this filter.StringmainFilterTipText()Returns the tip text for this property.booleanmayRemoveInstanceAfterFirstBatchDone()Derived filters may removed rows.StringpreFilterTipText()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.voidsetMainFilter(weka.filters.Filter value)Sets the main filter to use.voidsetOptions(String[] options)Parses the options for this object.voidsetPreFilter(weka.filters.Filter value)Sets the pre-filter to use.-
Methods inherited from class weka.filters.SimpleBatchFilter
batchFinished, hasImmediateOutputFormat, input, input
-
Methods inherited from class weka.filters.Filter
batchFilterFile, bufferInput, copyValues, copyValues, debugTipText, doNotCheckCapabilitiesTipText, filterFile, flushInput, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputFormatPeek, outputPeek, postExecution, preExecution, push, push, resetQueue, run, runFilter, setDebug, setDoNotCheckCapabilities, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper
-
-
-
-
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
Parses the options for this object.- Specified by:
setOptionsin interfaceweka.core.OptionHandler- Overrides:
setOptionsin classweka.filters.Filter- Parameters:
options- the options to use- Throws:
Exception- if setting of options fails
-
getOptions
public String[] getOptions()
Gets the current settings of the classifier.- Specified by:
getOptionsin interfaceweka.core.OptionHandler- Overrides:
getOptionsin classweka.filters.Filter- Returns:
- an array of strings suitable for passing to setOptions
-
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
-
mayRemoveInstanceAfterFirstBatchDone
public boolean mayRemoveInstanceAfterFirstBatchDone()
Derived filters may removed rows.- Overrides:
mayRemoveInstanceAfterFirstBatchDonein classweka.filters.Filter- Returns:
- true if instances might get removed
-
getDefaultPreFilter
protected weka.filters.Filter getDefaultPreFilter()
Returns the default pre-filter.- Returns:
- the default
-
setPreFilter
public void setPreFilter(weka.filters.Filter value)
Sets the pre-filter to use.- Parameters:
value- the filter
-
getPreFilter
public weka.filters.Filter getPreFilter()
Returns the pre-filter in use.- Returns:
- the filter
-
preFilterTipText
public String preFilterTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getDefaultMainFilter
protected weka.filters.Filter getDefaultMainFilter()
Returns the default main filter.- Returns:
- the default
-
setMainFilter
public void setMainFilter(weka.filters.Filter value)
Sets the main filter to use.- Parameters:
value- the filter
-
getMainFilter
public weka.filters.Filter getMainFilter()
Returns the main filter in use.- Returns:
- the filter
-
mainFilterTipText
public String mainFilterTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
allowAccessToFullInputFormat
public boolean allowAccessToFullInputFormat()
Returns whether to allow the determineOutputFormat(Instances) method access to the full dataset rather than just the header.- Overrides:
allowAccessToFullInputFormatin classweka.filters.SimpleBatchFilter- Returns:
- whether determineOutputFormat has access to the full input dataset
-
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- 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 running this filter.- Parameters:
args- should contain arguments to the filter: use -h for help
-
-