public class SubsetByExpression extends SimpleBatchFilter
-E <expr> The expression to use for filtering (default: true).
-F Apply the filter to instances that arrive after the first (training) batch. The default is to not apply the filter (i.e. always return the instance)
Modifier and Type | Field and Description |
---|---|
protected String |
m_Expression
the expresion to use for filtering.
|
protected boolean |
m_filterAfterFirstBatch
Whether to filter instances after the first batch has been processed
|
m_Debug
m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts
Constructor and Description |
---|
SubsetByExpression() |
Modifier and Type | Method and Description |
---|---|
protected Instances |
determineOutputFormat(Instances inputFormat)
Determines the output format based on the input format and returns
this.
|
String |
expressionTipText()
Returns the tip text for this property.
|
String |
filterAfterFirstBatchTipText()
Returns the tip text for this property.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
String |
getExpression()
Returns the expression used for filtering.
|
boolean |
getFilterAfterFirstBatch()
Get whether to apply the filter to instances that arrive once
the first (training) batch has been seen.
|
String[] |
getOptions()
Gets the current settings of the filter.
|
String |
getRevision()
Returns the revision string.
|
String |
globalInfo()
Returns a string describing this filter.
|
boolean |
input(Instance instance)
Input an instance for filtering.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] args)
Main method for running this filter.
|
protected Instances |
process(Instances instances)
Processes the given data (may change the provided dataset) and returns
the modified version.
|
void |
setExpression(String value)
Sets the expression used for filtering.
|
void |
setFilterAfterFirstBatch(boolean b)
Set whether to apply the filter to instances that arrive once
the first (training) batch has been seen.
|
void |
setOptions(String[] options)
Parses a given list of options.
|
batchFinished, hasImmediateOutputFormat
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
protected String m_Expression
protected boolean m_filterAfterFirstBatch
public String globalInfo()
globalInfo
in class SimpleFilter
public boolean input(Instance instance) throws Exception
input
in class SimpleBatchFilter
instance
- the input instanceIllegalStateException
- if no input structure has been definedException
- if something goes wrongSimpleBatchFilter.batchFinished()
public Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class SimpleFilter
public void setOptions(String[] options) throws Exception
-E <expr> The expression to use for filtering (default: true).
-F Apply the filter to instances that arrive after the first (training) batch. The default is to not apply the filter (i.e. always return the instance)
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 Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
public void setExpression(String value)
value
- the expressionpublic String getExpression()
public String expressionTipText()
public void setFilterAfterFirstBatch(boolean b)
b
- true if the filter should be applied to instances that
arrive after the first (training) batch has been processed.public boolean getFilterAfterFirstBatch()
public String filterAfterFirstBatchTipText()
protected Instances determineOutputFormat(Instances inputFormat) throws Exception
determineOutputFormat
in class SimpleFilter
inputFormat
- the input format to base the output format onException
- in case the determination goes wrongSimpleFilter.hasImmediateOutputFormat()
,
Filter.batchFinished()
protected Instances process(Instances instances) throws Exception
process
in class SimpleFilter
instances
- the data to processException
- in case the processing goes wrongSimpleBatchFilter.batchFinished()
public String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Filter
public static void main(String[] args)
args
- arguments for the filter: use -h for helpCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.