public class ClassAssigner extends SimpleStreamFilter implements WeightedInstancesHandler, WeightedAttributesHandler
-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)
| Modifier and Type | Field and Description |
|---|---|
static int |
FIRST
use the first attribute as class.
|
static int |
LAST
use the last attribute as class.
|
protected int |
m_ClassIndex
the class index.
|
static int |
UNSET
unset the class attribute.
|
m_Debug, m_DoNotCheckCapabilities, m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts| Constructor and Description |
|---|
ClassAssigner() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
classIndexTipText()
Returns the tip text for this property.
|
protected Instances |
determineOutputFormat(Instances inputFormat)
Determines the output format based on the input format and returns this.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
java.lang.String |
getClassIndex()
returns the class index.
|
java.lang.String[] |
getOptions()
Gets the current settings of the filter.
|
java.lang.String |
getRevision()
Returns the revision string.
|
java.lang.String |
globalInfo()
Returns a string describing this classifier.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for executing this class.
|
protected Instance |
process(Instance instance)
processes the given instance (may change the provided instance) and returns
the modified version.
|
void |
setClassIndex(java.lang.String value)
sets the class index.
|
void |
setOptions(java.lang.String[] options)
Parses a list of options for this object.
|
batchFinished, hasImmediateOutputFormat, input, preprocess, processreset, setInputFormatbatchFilterFile, bufferInput, copyValues, copyValues, debugTipText, doNotCheckCapabilitiesTipText, filterFile, flushInput, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputFormatPeek, outputPeek, postExecution, preExecution, push, push, resetQueue, run, runFilter, setDebug, setDoNotCheckCapabilities, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapperpublic static final int FIRST
public static final int LAST
public static final int UNSET
protected int m_ClassIndex
public java.lang.String globalInfo()
globalInfo in class SimpleFilterpublic java.util.Enumeration<Option> listOptions()
listOptions in interface OptionHandlerlistOptions in class Filterpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-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)
setOptions in interface OptionHandlersetOptions in class Filteroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class Filterpublic java.lang.String classIndexTipText()
public void setClassIndex(java.lang.String value)
value - the class indexpublic java.lang.String getClassIndex()
public Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class FilterCapabilitiesprotected Instances determineOutputFormat(Instances inputFormat) throws java.lang.Exception
determineOutputFormat in class SimpleStreamFilterinputFormat - the input format to base the output format onjava.lang.Exception - in case the class index is invalidSimpleStreamFilter.hasImmediateOutputFormat(),
SimpleStreamFilter.batchFinished(),
SimpleStreamFilter.preprocess(Instances)protected Instance process(Instance instance) throws java.lang.Exception
process in class SimpleStreamFilterinstance - the instance to processjava.lang.Exception - in case the processing goes wrongpublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Filterpublic static void main(java.lang.String[] args)
args - should contain arguments for the filter: use -h for help