类 SubsetByExpression
java.lang.Object
weka.filters.Filter
weka.filters.SimpleFilter
weka.filters.SimpleBatchFilter
weka.filters.unsupervised.instance.SubsetByExpression
- 所有已实现的接口:
Serializable
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
Filters instances according to a user-specified expression.
Grammar:
boolexpr_list ::= boolexpr_list boolexpr_part | boolexpr_part;
boolexpr_part ::= boolexpr:e {: parser.setResult(e); :} ;
boolexpr ::= BOOLEAN
| true
| false
| expr < expr
| expr <= expr
| expr > expr
| expr >= expr
| expr = expr
| ( boolexpr )
| not boolexpr
| boolexpr and boolexpr
| boolexpr or boolexpr
| ATTRIBUTE is STRING
;
expr ::= NUMBER
| ATTRIBUTE
| ( expr )
| opexpr
| funcexpr
;
opexpr ::= expr + expr
| expr - expr
| expr * expr
| expr / expr
;
funcexpr ::= abs ( expr )
| sqrt ( expr )
| log ( expr )
| exp ( expr )
| sin ( expr )
| cos ( expr )
| tan ( expr )
| rint ( expr )
| floor ( expr )
| pow ( expr for base , expr for exponent )
| ceil ( expr )
;
Notes:
- NUMBER
any integer or floating point number
(but not in scientific notation!)
- STRING
any string surrounded by single quotes;
the string may not contain a single quote though.
- ATTRIBUTE
the following placeholders are recognized for
attribute values:
- CLASS for the class value in case a class attribute is set.
- ATTxyz with xyz a number from 1 to # of attributes in the
dataset, representing the value of indexed attribute.
Examples:
- extracting only mammals and birds from the 'zoo' UCI dataset:
(CLASS is 'mammal') or (CLASS is 'bird')
- extracting only animals with at least 2 legs from the 'zoo' UCI dataset:
(ATT14 >= 2)
- extracting only instances with non-missing 'wage-increase-second-year'
from the 'labor' UCI dataset:
not ismissing(ATT3)
Valid options are:
Grammar:
boolexpr_list ::= boolexpr_list boolexpr_part | boolexpr_part;
boolexpr_part ::= boolexpr:e {: parser.setResult(e); :} ;
boolexpr ::= BOOLEAN
| true
| false
| expr < expr
| expr <= expr
| expr > expr
| expr >= expr
| expr = expr
| ( boolexpr )
| not boolexpr
| boolexpr and boolexpr
| boolexpr or boolexpr
| ATTRIBUTE is STRING
;
expr ::= NUMBER
| ATTRIBUTE
| ( expr )
| opexpr
| funcexpr
;
opexpr ::= expr + expr
| expr - expr
| expr * expr
| expr / expr
;
funcexpr ::= abs ( expr )
| sqrt ( expr )
| log ( expr )
| exp ( expr )
| sin ( expr )
| cos ( expr )
| tan ( expr )
| rint ( expr )
| floor ( expr )
| pow ( expr for base , expr for exponent )
| ceil ( expr )
;
Notes:
- NUMBER
any integer or floating point number
(but not in scientific notation!)
- STRING
any string surrounded by single quotes;
the string may not contain a single quote though.
- ATTRIBUTE
the following placeholders are recognized for
attribute values:
- CLASS for the class value in case a class attribute is set.
- ATTxyz with xyz a number from 1 to # of attributes in the
dataset, representing the value of indexed attribute.
Examples:
- extracting only mammals and birds from the 'zoo' UCI dataset:
(CLASS is 'mammal') or (CLASS is 'bird')
- extracting only animals with at least 2 legs from the 'zoo' UCI dataset:
(ATT14 >= 2)
- extracting only instances with non-missing 'wage-increase-second-year'
from the 'labor' UCI dataset:
not ismissing(ATT3)
Valid options are:
-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)
- 版本:
- $Revision: 9804 $
- 作者:
- fracpete (fracpete at waikato dot ac dot nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Returns the tip text for this property.Returns the tip text for this property.Returns the Capabilities of this filter.Returns the expression used for filtering.boolean
Get whether to apply the filter to instances that arrive once the first (training) batch has been seen.String[]
Gets the current settings of the filter.Returns the revision string.Returns a string describing this filter.boolean
Input an instance for filtering.Returns an enumeration describing the available options.static void
Main method for running this filter.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.从类继承的方法 weka.filters.SimpleBatchFilter
batchFinished
从类继承的方法 weka.filters.SimpleFilter
debugTipText, getDebug, setDebug, setInputFormat
从类继承的方法 weka.filters.Filter
batchFilterFile, filterFile, getCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputPeek, toString, useFilter, wekaStaticWrapper
-
构造器详细资料
-
SubsetByExpression
public SubsetByExpression()
-
-
方法详细资料
-
globalInfo
Returns a string describing this filter.- 指定者:
globalInfo
在类中SimpleFilter
- 返回:
- a description of the filter suitable for displaying in the explorer/experimenter gui
-
input
Input an instance for filtering. Filter requires all training instances be read before producing output (calling the method batchFinished() makes the data available). If this instance is part of a new batch, m_NewBatch is set to false.- 覆盖:
input
在类中SimpleBatchFilter
- 参数:
instance
- the input instance- 返回:
- true if the filtered instance may now be collected with output().
- 抛出:
IllegalStateException
- if no input structure has been definedException
- if something goes wrong- 另请参阅:
-
listOptions
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 覆盖:
listOptions
在类中SimpleFilter
- 返回:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-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
在接口中OptionHandler
- 覆盖:
setOptions
在类中SimpleFilter
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported- 另请参阅:
-
SimpleFilter.reset()
-
getOptions
Gets the current settings of the filter.- 指定者:
getOptions
在接口中OptionHandler
- 覆盖:
getOptions
在类中SimpleFilter
- 返回:
- an array of strings suitable for passing to setOptions
-
getCapabilities
Returns the Capabilities of this filter.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中Filter
- 返回:
- the capabilities of this object
- 另请参阅:
-
setExpression
Sets the expression used for filtering.- 参数:
value
- the expression
-
getExpression
Returns the expression used for filtering.- 返回:
- the expression
-
expressionTipText
Returns the tip text for this property.- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setFilterAfterFirstBatch
public void setFilterAfterFirstBatch(boolean b) Set whether to apply the filter to instances that arrive once the first (training) batch has been seen. The default is to not apply the filter and just return each instance input. This is so that, when used in the FilteredClassifier, a test instance does not get "consumed" by the filter and a prediction is always generated.- 参数:
b
- true if the filter should be applied to instances that arrive after the first (training) batch has been processed.
-
getFilterAfterFirstBatch
public boolean getFilterAfterFirstBatch()Get whether to apply the filter to instances that arrive once the first (training) batch has been seen. The default is to not apply the filter and just return each instance input. This is so that, when used in the FilteredClassifier, a test instance does not get "consumed" by the filter and a prediction is always generated.- 返回:
- true if the filter should be applied to instances that arrive after the first (training) batch has been processed.
-
filterAfterFirstBatchTipText
Returns the tip text for this property.- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中Filter
- 返回:
- the revision
-
main
Main method for running this filter.- 参数:
args
- arguments for the filter: use -h for help
-