public class SubsetByExpression extends SimpleBatchFilter implements WeightedInstancesHandler, WeightedAttributesHandler
-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)
-output-debug-info If set, filter is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, filter capabilities are not checked when input format is set (use with caution).
Constructor and Description |
---|
SubsetByExpression() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
expressionTipText()
Returns the tip text for this property.
|
java.lang.String |
filterAfterFirstBatchTipText()
Returns the tip text for this property.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
java.lang.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.
|
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 filter.
|
boolean |
input(Instance instance)
Input an instance for filtering.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for running this filter.
|
boolean |
mayRemoveInstanceAfterFirstBatchDone()
SubsetByExpression may return false from input() (thus not making an
instance available immediately) even after the first batch has been
completed if the user has opted to apply the filter to instances after the
first batch (rather than just passing them through).
|
void |
setExpression(java.lang.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(java.lang.String[] options)
Parses a given list of options.
|
allowAccessToFullInputFormat, batchFinished, input
setInputFormat
batchFilterFile, debugTipText, doNotCheckCapabilitiesTipText, filterFile, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputPeek, postExecution, preExecution, run, runFilter, setDebug, setDoNotCheckCapabilities, toString, useFilter, wekaStaticWrapper
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public java.lang.String globalInfo()
globalInfo
in class SimpleFilter
public boolean mayRemoveInstanceAfterFirstBatchDone()
mayRemoveInstanceAfterFirstBatchDone
in class Filter
public boolean input(Instance instance) throws java.lang.Exception
input
in class SimpleBatchFilter
instance
- the input instancejava.lang.IllegalStateException
- if no input structure has been definedjava.lang.Exception
- if something goes wrongSimpleBatchFilter.batchFinished()
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class Filter
public void setOptions(java.lang.String[] options) throws java.lang.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)
-output-debug-info If set, filter is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, filter capabilities are not checked when input format is set (use with caution).
setOptions
in interface OptionHandler
setOptions
in class Filter
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class Filter
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
public void setExpression(java.lang.String value)
value
- the expressionpublic java.lang.String getExpression()
public java.lang.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 java.lang.String filterAfterFirstBatchTipText()
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Filter
public static void main(java.lang.String[] args)
args
- arguments for the filter: use -h for help