Class RemoveByName
java.lang.Object
weka.filters.Filter
weka.filters.SimpleFilter
weka.filters.SimpleStreamFilter
weka.filters.unsupervised.attribute.RemoveByName
- All Implemented Interfaces:
Serializable
,CapabilitiesHandler
,CapabilitiesIgnorer
,CommandlineRunnable
,OptionHandler
,RevisionHandler
,WeightedAttributesHandler
,WeightedInstancesHandler
,StreamableFilter
public class RemoveByName
extends SimpleStreamFilter
implements WeightedInstancesHandler, WeightedAttributesHandler
Removes attributes based on a regular expression
matched against their names.
Valid options are:
-D Turns on output of debugging information.
-E <regular expression> The regular expression to match the attribute names against. (default: ^.*id$)
-V Flag for inverting the matching sense. If set, attributes are kept instead of deleted. (default: off)
- Version:
- $Revision: 14508 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the tip text for this property.Returns the Capabilities of this filter.Returns the regular expression in use.boolean
Get whether the supplied columns are to be removed or kept.String[]
returns the options of the current setup.Returns the revision string.Returns a string describing this classifier.Returns the tip text for this property.Gets an enumeration describing the available options.static void
runs the filter with the given arguments.void
setExpression
(String value) Sets the regular expression to match the attribute names against.void
setInvertSelection
(boolean value) Set whether selected columns should be removed or kept.void
setOptions
(String[] options) Parses the options for this object.Methods inherited from class weka.filters.SimpleStreamFilter
batchFinished, input
Methods inherited from class weka.filters.SimpleFilter
setInputFormat
Methods inherited from class weka.filters.Filter
batchFilterFile, debugTipText, doNotCheckCapabilitiesTipText, filterFile, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, postExecution, preExecution, run, runFilter, setDebug, setDoNotCheckCapabilities, toString, useFilter, wekaStaticWrapper
-
Field Details
-
DEFAULT_EXPRESSION
the default expression.- See Also:
-
-
Constructor Details
-
RemoveByName
public RemoveByName()
-
-
Method Details
-
globalInfo
Returns a string describing this classifier.- Specified by:
globalInfo
in classSimpleFilter
- Returns:
- a description of the classifier suitable for displaying in the explorer/experimenter gui
-
listOptions
Gets an enumeration describing the available options.- Specified by:
listOptions
in interfaceOptionHandler
- Overrides:
listOptions
in classFilter
- Returns:
- an enumeration of all the available options.
-
getOptions
returns the options of the current setup.- Specified by:
getOptions
in interfaceOptionHandler
- Overrides:
getOptions
in classFilter
- Returns:
- the current options
-
setOptions
Parses the options for this object. Valid options are:-D Turns on output of debugging information.
-E <regular expression> The regular expression to match the attribute names against. (default: ^.*id$)
-V Flag for inverting the matching sense. If set, attributes are kept instead of deleted. (default: off)
- Specified by:
setOptions
in interfaceOptionHandler
- Overrides:
setOptions
in classFilter
- Parameters:
options
- the options to use- Throws:
Exception
- if the option setting fails
-
setExpression
Sets the regular expression to match the attribute names against.- Parameters:
value
- the regular expression
-
getExpression
Returns the regular expression in use.- Returns:
- the regular expression
-
expressionTipText
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setInvertSelection
public void setInvertSelection(boolean value) Set whether selected columns should be removed or kept. If true the selected columns are kept and unselected columns are deleted. If false selected columns are deleted and unselected columns are kept.- Parameters:
value
- the new invert setting
-
getInvertSelection
public boolean getInvertSelection()Get whether the supplied columns are to be removed or kept.- Returns:
- true if the supplied columns will be kept
-
invertSelectionTipText
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getCapabilities
Returns the Capabilities of this filter.- Specified by:
getCapabilities
in interfaceCapabilitiesHandler
- Overrides:
getCapabilities
in classFilter
- Returns:
- the capabilities of this object
- See Also:
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Overrides:
getRevision
in classFilter
- Returns:
- the revision
-
main
runs the filter with the given arguments.- Parameters:
args
- the commandline arguments
-