Class ClassAssigner
- java.lang.Object
-
- weka.filters.Filter
-
- weka.filters.SimpleFilter
-
- weka.filters.SimpleStreamFilter
-
- weka.filters.unsupervised.attribute.ClassAssigner
-
- All Implemented Interfaces:
java.io.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: 14534 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClassAssigner()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringclassIndexTipText()Returns the tip text for this property.CapabilitiesgetCapabilities()Returns the Capabilities of this filter.java.lang.StringgetClassIndex()returns the class index.java.lang.String[]getOptions()Gets the current settings of the filter.java.lang.StringgetRevision()Returns the revision string.java.lang.StringglobalInfo()Returns a string describing this classifier.java.util.Enumeration<Option>listOptions()Returns an enumeration describing the available options.static voidmain(java.lang.String[] args)Main method for executing this class.voidsetClassIndex(java.lang.String value)sets the class index.voidsetOptions(java.lang.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 Detail
-
FIRST
public static final int FIRST
use the first attribute as class.- See Also:
- Constant Field Values
-
LAST
public static final int LAST
use the last attribute as class.- See Also:
- Constant Field Values
-
UNSET
public static final int UNSET
unset the class attribute.- See Also:
- Constant Field Values
-
-
Method Detail
-
globalInfo
public java.lang.String globalInfo()
Returns a string describing this classifier.- Specified by:
globalInfoin classSimpleFilter- Returns:
- a description of the classifier suitable for displaying in the explorer/experimenter gui
-
listOptions
public java.util.Enumeration<Option> listOptions()
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Overrides:
listOptionsin classFilter- Returns:
- an enumeration of all the available options.
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.ExceptionParses 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:
setOptionsin interfaceOptionHandler- Overrides:
setOptionsin classFilter- Parameters:
options- the list of options as an array of strings- Throws:
java.lang.Exception- if an option is not supported
-
getOptions
public java.lang.String[] getOptions()
Gets the current settings of the filter.- Specified by:
getOptionsin interfaceOptionHandler- Overrides:
getOptionsin classFilter- Returns:
- an array of strings suitable for passing to setOptions
-
classIndexTipText
public java.lang.String classIndexTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setClassIndex
public void setClassIndex(java.lang.String value)
sets the class index.- Parameters:
value- the class index
-
getClassIndex
public java.lang.String getClassIndex()
returns the class index.- Returns:
- the class index
-
getCapabilities
public Capabilities getCapabilities()
Returns the Capabilities of this filter.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Overrides:
getCapabilitiesin classFilter- Returns:
- the capabilities of this object
- See Also:
Capabilities
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classFilter- Returns:
- the revision
-
main
public static void main(java.lang.String[] args)
Main method for executing this class.- Parameters:
args- should contain arguments for the filter: use -h for help
-
-