Class ClassAssigner
java.lang.Object
weka.filters.Filter
weka.filters.SimpleFilter
weka.filters.SimpleStreamFilter
weka.filters.unsupervised.attribute.ClassAssigner
- All Implemented Interfaces:
Serializable
,CapabilitiesHandler
,CapabilitiesIgnorer
,CommandlineRunnable
,OptionHandler
,RevisionHandler
,WeightedAttributesHandler
,WeightedInstancesHandler
,StreamableFilter
public class ClassAssigner
extends SimpleStreamFilter
implements WeightedInstancesHandler, WeightedAttributesHandler
Filter that can set and unset the class index.
Valid options are:
-D Turns on output of debugging information.
-C <num|first|last|0> The index of the class attribute. Index starts with 1, 'first' and 'last' are accepted, '0' unsets the class index. (default: last)
- 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 class index.String[]
Gets the current settings of the filter.Returns the revision string.Returns a string describing this classifier.Returns an enumeration describing the available options.static void
Main method for executing this class.void
setClassIndex
(String value) sets the class index.void
setOptions
(String[] options) Parses a list of 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
-
FIRST
public static final int FIRSTuse the first attribute as class.- See Also:
-
LAST
public static final int LASTuse the last attribute as class.- See Also:
-
UNSET
public static final int UNSETunset the class attribute.- See Also:
-
-
Constructor Details
-
ClassAssigner
public ClassAssigner()
-
-
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
Returns an enumeration describing the available options.- Specified by:
listOptions
in interfaceOptionHandler
- Overrides:
listOptions
in classFilter
- Returns:
- an enumeration of all the available options.
-
setOptions
Parses a list of options for this object. Valid options are:-D Turns on output of debugging information.
-C <num|first|last|0> The index of the class attribute. Index starts with 1, 'first' and 'last' are accepted, '0' unsets the class index. (default: last)
- Specified by:
setOptions
in interfaceOptionHandler
- Overrides:
setOptions
in classFilter
- Parameters:
options
- the list of options as an array of strings- Throws:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the filter.- Specified by:
getOptions
in interfaceOptionHandler
- Overrides:
getOptions
in classFilter
- Returns:
- an array of strings suitable for passing to setOptions
-
classIndexTipText
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setClassIndex
sets the class index.- Parameters:
value
- the class index
-
getClassIndex
returns the class index.- Returns:
- the class index
-
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
Main method for executing this class.- Parameters:
args
- should contain arguments for the filter: use -h for help
-