public class RemoveWithValues extends Filter implements UnsupervisedFilter, StreamableFilter, OptionHandler
-C <num> Choose attribute to be used for selection.
-S <num> Numeric value to be used for selection on numeric attribute. Instances with values smaller than given value will be selected. (default 0)
-L <index1,index2-index4,...> Range of label indices to be used for selection on nominal attribute. First and last are valid indexes. (default all values)
-M Missing values count as a match. This setting is independent of the -V option. (default missing values don't match)
-V Invert matching sense.
-H When selecting on nominal attributes, removes header references to excluded values.
Constructor and Description |
---|
RemoveWithValues()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
attributeIndexTipText()
Returns the tip text for this property
|
java.lang.String |
getAttributeIndex()
Get the index of the attribute used.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
boolean |
getInvertSelection()
Get whether the supplied columns are to be removed or kept
|
boolean |
getMatchMissingValues()
Gets whether missing values are counted as a match.
|
boolean |
getModifyHeader()
Gets whether the header will be modified when selecting on nominal
attributes.
|
java.lang.String |
getNominalIndices()
Get the set of nominal value indices that will be used for selection
|
java.lang.String[] |
getOptions()
Gets the current settings of the filter.
|
java.lang.String |
getRevision()
Returns the revision string.
|
double |
getSplitPoint()
Get the split point used for numeric selection
|
java.lang.String |
globalInfo()
Returns a string describing this classifier
|
boolean |
input(Instance instance)
Input an instance for filtering.
|
java.lang.String |
invertSelectionTipText()
Returns the tip text for this property
|
boolean |
isNominal()
Returns true if selection attribute is nominal.
|
boolean |
isNumeric()
Returns true if selection attribute is numeric.
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
java.lang.String |
matchMissingValuesTipText()
Returns the tip text for this property
|
java.lang.String |
modifyHeaderTipText()
Returns the tip text for this property
|
java.lang.String |
nominalIndicesTipText()
Returns the tip text for this property
|
void |
setAttributeIndex(java.lang.String attIndex)
Sets index of the attribute used.
|
boolean |
setInputFormat(Instances instanceInfo)
Sets the format of the input instances.
|
void |
setInvertSelection(boolean invert)
Set whether selected values should be removed or kept.
|
void |
setMatchMissingValues(boolean newMatchMissingValues)
Sets whether missing values are counted as a match.
|
void |
setModifyHeader(boolean newModifyHeader)
Sets whether the header will be modified when selecting on nominal
attributes.
|
void |
setNominalIndices(java.lang.String rangeList)
Set which nominal labels are to be included in the selection.
|
void |
setNominalIndicesArr(int[] values)
Set which values of a nominal attribute are to be used for
selection.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setSplitPoint(double value)
Split point to be used for selection on numeric attribute.
|
java.lang.String |
splitPointTipText()
Returns the tip text for this property
|
batchFilterFile, batchFinished, filterFile, getCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputPeek, toString, useFilter, wekaStaticWrapper
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-C <num> Choose attribute to be used for selection.
-S <num> Numeric value to be used for selection on numeric attribute. Instances with values smaller than given value will be selected. (default 0)
-L <index1,index2-index4,...> Range of label indices to be used for selection on nominal attribute. First and last are valid indexes. (default all values)
-M Missing values count as a match. This setting is independent of the -V option. (default missing values don't match)
-V Invert matching sense.
-H When selecting on nominal attributes, removes header references to excluded values.
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
public boolean setInputFormat(Instances instanceInfo) throws java.lang.Exception
setInputFormat
in class Filter
instanceInfo
- an Instances object containing the input instance
structure (any instances contained in the object are ignored - only the
structure is required).UnsupportedAttributeTypeException
- if the specified attribute
is neither numeric or nominal.java.lang.Exception
- if the inputFormat can't be set successfullypublic boolean input(Instance instance)
public boolean isNominal()
public boolean isNumeric()
public java.lang.String modifyHeaderTipText()
public boolean getModifyHeader()
public void setModifyHeader(boolean newModifyHeader)
newModifyHeader
- true if so.public java.lang.String attributeIndexTipText()
public java.lang.String getAttributeIndex()
public void setAttributeIndex(java.lang.String attIndex)
attIndex
- the index of the attributepublic java.lang.String splitPointTipText()
public double getSplitPoint()
public void setSplitPoint(double value)
value
- the split pointpublic java.lang.String matchMissingValuesTipText()
public boolean getMatchMissingValues()
public void setMatchMissingValues(boolean newMatchMissingValues)
newMatchMissingValues
- true if missing values are counted as a match.public java.lang.String invertSelectionTipText()
public boolean getInvertSelection()
public void setInvertSelection(boolean invert)
invert
- the new invert settingpublic java.lang.String nominalIndicesTipText()
public java.lang.String getNominalIndices()
public void setNominalIndices(java.lang.String rangeList)
rangeList
- a string representing the list of nominal indices.
eg: first-3,5,6-lastInvalidArgumentException
- if an invalid range list is suppliedpublic void setNominalIndicesArr(int[] values)
values
- an array containing indexes of values to be
used for selectionInvalidArgumentException
- if an invalid set of ranges is suppliedpublic java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Filter
public static void main(java.lang.String[] argv)
argv
- should contain arguments to the filter:
use -h for help