public class RemoveFrequentValues extends Filter implements OptionHandler, UnsupervisedFilter
-C <num> Choose attribute to be used for selection.
-N <num> Number of values to retain for the sepcified attribute, i.e. the ones with the most instances (default 2).
-L Instead of values with the most instances the ones with the least are retained.
-H When selecting on nominal attributes, removes header references to excluded values.
-V Invert matching sense.
| Constructor and Description |
|---|
RemoveFrequentValues() |
| Modifier and Type | Method and Description |
|---|---|
String |
attributeIndexTipText()
Returns the tip text for this property
|
boolean |
batchFinished()
Signifies that this batch of input to the filter is finished.
|
void |
determineValues(Instances inst)
determines the values to retain, it is always at least 1 and up to the
maximum number of distinct values
|
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 |
getModifyHeader()
Gets whether the header will be modified when selecting on nominal
attributes.
|
int |
getNumValues()
Gets how many values are retained
|
String[] |
getOptions()
Gets the current settings of the filter.
|
String |
getRevision()
Returns the revision string.
|
boolean |
getUseLeastValues()
Gets whether to use values with least or most instances
|
String |
globalInfo()
Returns a string describing this filter
|
boolean |
input(Instance instance)
Input an instance for filtering.
|
String |
invertSelectionTipText()
Returns the tip text for this property
|
boolean |
isNominal()
Returns true if selection attribute is nominal.
|
Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] argv)
Main method for testing this class.
|
String |
modifyHeaderTipText()
Returns the tip text for this property
|
String |
numValuesTipText()
Returns the tip text for this property
|
void |
setAttributeIndex(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 |
setModifyHeader(boolean newModifyHeader)
Sets whether the header will be modified when selecting on nominal
attributes.
|
void |
setNumValues(int numValues)
Sets how many values are retained
|
void |
setOptions(String[] options)
Parses a given list of options.
|
void |
setUseLeastValues(boolean leastValues)
Sets whether to use values with least or most instances
|
String |
useLeastValuesTipText()
Returns the tip text for this property
|
batchFilterFile, filterFile, getCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, runFilter, toString, useFilter, wekaStaticWrapperpublic String globalInfo()
public Enumeration<Option> listOptions()
listOptions in interface OptionHandlerpublic void setOptions(String[] options) throws Exception
-C <num> Choose attribute to be used for selection.
-N <num> Number of values to retain for the sepcified attribute, i.e. the ones with the most instances (default 2).
-L Instead of values with the most instances the ones with the least are retained.
-H When selecting on nominal attributes, removes header references to excluded values.
-V Invert matching sense.
setOptions in interface OptionHandleroptions - the list of options as an array of stringsException - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlerpublic String attributeIndexTipText()
public String getAttributeIndex()
public void setAttributeIndex(String attIndex)
attIndex - the index of the attributepublic String numValuesTipText()
public int getNumValues()
public void setNumValues(int numValues)
numValues - the number of values to retainpublic String useLeastValuesTipText()
public boolean getUseLeastValues()
public void setUseLeastValues(boolean leastValues)
leastValues - whether values with least or most instances are retainedpublic String modifyHeaderTipText()
public boolean getModifyHeader()
public void setModifyHeader(boolean newModifyHeader)
newModifyHeader - true if so.public String invertSelectionTipText()
public boolean getInvertSelection()
public void setInvertSelection(boolean invert)
invert - the new invert settingpublic boolean isNominal()
public void determineValues(Instances inst)
inst - the Instances to determine the values from which are keptpublic Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class FilterCapabilitiespublic boolean setInputFormat(Instances instanceInfo) throws Exception
setInputFormat in class FilterinstanceInfo - 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 not
nominal.Exception - if the inputFormat can't be set successfullypublic boolean input(Instance instance)
input in class Filterinstance - the input instanceIllegalStateException - if no input format has been set.public boolean batchFinished()
batchFinished in class FilterIllegalStateException - if no input structure has been definedpublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class Filterpublic static void main(String[] argv)
argv - should contain arguments to the filter: use -h for helpCopyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.