Class SortLabels
java.lang.Object
weka.filters.Filter
weka.filters.SimpleFilter
weka.filters.SimpleStreamFilter
weka.filters.unsupervised.attribute.SortLabels
- All Implemented Interfaces:
Serializable,CapabilitiesHandler,CapabilitiesIgnorer,CommandlineRunnable,OptionHandler,RevisionHandler,WeightedAttributesHandler,WeightedInstancesHandler,StreamableFilter
public class SortLabels
extends SimpleStreamFilter
implements WeightedInstancesHandler, WeightedAttributesHandler
A simple filter for sorting the labels of nominal
attributes.
Valid options are:
-D Turns on output of debugging information.
-R <index1,index2-index4,...> Specify list of attributes to process. (default: select all nominal attributes)
-V Inverts the matching sense of the selection.
-S <CASE|NON-CASE> Determines the type of sorting: CASE = Case-sensitive NON-CASE = Case-insensitive (default: CASE)
- Version:
- $Revision: 14534 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a case-insensitive comparator for two strings.static classRepresents a case-sensitive comparator for two strings. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intsorts the strings case-insensitive.static final intsorts the strings case-sensitive.static final Tag[]Tag allowing selection of sort type. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the tip text for this property.Gets the current selected attributes.Returns the Capabilities of this filter.booleanGets whether the supplied columns are to be processed or skipped.String[]Gets the current settings of the classifier.Returns the revision string.Gets the sort type to be used.Returns a string describing this filter.Returns the tip text for this property.Returns an enumeration describing the available options.static voidruns the filter with the given arguments.voidsetAttributeIndices(String value) Set the range of attributes to process.voidsetInvertSelection(boolean value) Sets whether selected columns should be processed or skipped.voidsetOptions(String[] options) Parses the options for this object.voidsetSortType(SelectedTag type) Sets the sort type to be used.Returns the tip text for this property.Methods inherited from class weka.filters.SimpleStreamFilter
batchFinished, inputMethods inherited from class weka.filters.SimpleFilter
setInputFormatMethods 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
-
SORT_CASESENSITIVE
public static final int SORT_CASESENSITIVEsorts the strings case-sensitive.- See Also:
-
SORT_CASEINSENSITIVE
public static final int SORT_CASEINSENSITIVEsorts the strings case-insensitive.- See Also:
-
TAGS_SORTTYPE
Tag allowing selection of sort type.
-
-
Constructor Details
-
SortLabels
public SortLabels()
-
-
Method Details
-
globalInfo
Returns a string describing this filter.- Specified by:
globalInfoin classSimpleFilter- Returns:
- a description of the filter suitable for displaying in the explorer/experimenter gui
-
listOptions
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Overrides:
listOptionsin classFilter- Returns:
- an enumeration of all the available options.
-
setOptions
Parses the options for this object. Valid options are:-D Turns on output of debugging information.
-R <index1,index2-index4,...> Specify list of attributes to process. (default: select all nominal attributes)
-V Inverts the matching sense of the selection.
-S <CASE|NON-CASE> Determines the type of sorting: CASE = Case-sensitive NON-CASE = Case-insensitive (default: CASE)
- Specified by:
setOptionsin interfaceOptionHandler- Overrides:
setOptionsin classFilter- Parameters:
options- the options to use- Throws:
Exception- if setting of options fails
-
getOptions
Gets the current settings of the classifier.- Specified by:
getOptionsin interfaceOptionHandler- Overrides:
getOptionsin classFilter- Returns:
- an array of strings suitable for passing to setOptions
-
attributeIndicesTipText
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setAttributeIndices
Set the range of attributes to process.- Parameters:
value- the new range.
-
getAttributeIndices
Gets the current selected attributes.- Returns:
- current selection.
-
invertSelectionTipText
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) Sets whether selected columns should be processed or skipped.- Parameters:
value- the new invert setting
-
getInvertSelection
public boolean getInvertSelection()Gets whether the supplied columns are to be processed or skipped.- Returns:
- true if the supplied columns will be kept
-
sortTypeTipText
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setSortType
Sets the sort type to be used.- Parameters:
type- the type of sorting
-
getSortType
Gets the sort type to be used.- Returns:
- the sort type
-
getCapabilities
Returns the Capabilities of this filter.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Overrides:
getCapabilitiesin classFilter- Returns:
- the capabilities of this object
- See Also:
-
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classFilter- Returns:
- the revision
-
main
runs the filter with the given arguments.- Parameters:
args- the commandline arguments
-