public class ClassAssigner extends SimpleStreamFilter
-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_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts
Constructor and Description |
---|
ClassAssigner() |
Modifier and Type | Method and Description |
---|---|
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.
|
String |
getClassIndex()
returns the class index.
|
String[] |
getOptions()
Gets the current settings of the filter.
|
String |
getRevision()
Returns the revision string.
|
String |
globalInfo()
Returns a string describing this classifier.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(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(String value)
sets the class index.
|
void |
setOptions(String[] options)
Parses a list of options for this object.
|
batchFinished, hasImmediateOutputFormat, input, preprocess, process
debugTipText, getDebug, reset, setDebug, setInputFormat
batchFilterFile, bufferInput, copyValues, copyValues, filterFile, flushInput, getCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputFormatPeek, outputPeek, push, resetQueue, runFilter, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper
public static final int FIRST
public static final int LAST
public static final int UNSET
protected int m_ClassIndex
public String globalInfo()
globalInfo
in class SimpleFilter
public Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class SimpleFilter
public void setOptions(String[] options) throws 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 OptionHandler
setOptions
in class SimpleFilter
options
- the list of options as an array of stringsException
- if an option is not supportedSimpleFilter.reset()
public String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class SimpleFilter
public String classIndexTipText()
public void setClassIndex(String value)
value
- the class indexpublic String getClassIndex()
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
protected Instances determineOutputFormat(Instances inputFormat) throws Exception
determineOutputFormat
in class SimpleStreamFilter
inputFormat
- the input format to base the output format onException
- in case the class index is invalidSimpleStreamFilter.hasImmediateOutputFormat()
,
SimpleStreamFilter.batchFinished()
,
SimpleStreamFilter.preprocess(Instances)
protected Instance process(Instance instance) throws Exception
process
in class SimpleStreamFilter
instance
- the instance to processException
- in case the processing goes wrongpublic String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Filter
public static void main(String[] args)
args
- should contain arguments for the filter: use -h for helpCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.