|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.filters.Filter
weka.filters.unsupervised.attribute.PotentialClassIgnorer
weka.filters.unsupervised.attribute.MathExpression
public class MathExpression
Modify numeric attributes according to a given expression
Valid options are:-unset-class-temporarily Unsets the class index temporarily before the filter is applied to the data. (default: no)
-E <expression> Specify the expression to apply. Eg. pow(A,6)/(MEAN+MAX) Supported operators are +, -, *, /, pow, log, abs, cos, exp, sqrt, tan, sin, ceil, floor, rint, (, ), MEAN, MAX, MIN, SD, COUNT, SUM, SUMSQUARED, ifelse
-R <index1,index2-index4,...> Specify list of columns to ignore. First and last are valid indexes. (default none)
-V Invert matching sense (i.e. only modify specified columns)
MathematicalExpression
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
m_defaultExpression
The default modification expression |
Constructor Summary | |
---|---|
MathExpression()
Constructor |
Method Summary | |
---|---|
boolean |
batchFinished()
Signify that this batch of input to the filter is finished. |
java.lang.String |
expressionTipText()
Returns the tip text for this property |
Capabilities |
getCapabilities()
Returns the Capabilities of this filter. |
java.lang.String |
getExpression()
Get the expression |
java.lang.String |
getIgnoreRange()
Get the current range selection. |
boolean |
getInvertSelection()
Get whether the supplied columns are to be select or unselect |
java.lang.String[] |
getOptions()
Gets the current settings of the filter. |
java.lang.String |
globalInfo()
Returns a string describing this filter |
java.lang.String |
ignoreRangeTipText()
Returns the tip text for this property |
boolean |
input(Instance instance)
Input an instance for filtering. |
java.lang.String |
invertSelectionTipText()
Returns the tip text for this property |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
void |
setExpression(java.lang.String expr)
Set the expression to apply |
void |
setIgnoreRange(java.lang.String rangeList)
Set which attributes are to be ignored |
boolean |
setInputFormat(Instances instanceInfo)
Sets the format of the input instances. |
void |
setInvertSelection(boolean invert)
Set whether selected columns should be select or unselect. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
Methods inherited from class weka.filters.unsupervised.attribute.PotentialClassIgnorer |
---|
getIgnoreClass, getOutputFormat, ignoreClassTipText, setIgnoreClass |
Methods inherited from class weka.filters.Filter |
---|
batchFilterFile, filterFile, getCapabilities, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputPeek, toString, useFilter, wekaStaticWrapper |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String m_defaultExpression
Constructor Detail |
---|
public MathExpression()
Method Detail |
---|
public java.lang.String globalInfo()
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
public boolean setInputFormat(Instances instanceInfo) throws java.lang.Exception
setInputFormat
in class PotentialClassIgnorer
instanceInfo
- an Instances object containing the input
instance structure (any instances contained in the object are
ignored - only the structure is required).
java.lang.Exception
- if the input format can't be set
successfullypublic boolean input(Instance instance) throws java.lang.Exception
input
in class Filter
instance
- the input instance
java.lang.IllegalStateException
- if no input format has been set.
java.lang.NullPointerException
- if the input format has not been
defined.
java.lang.Exception
- if the input instance was not of the correct
format or if there was a problem with the filtering.public boolean batchFinished() throws java.lang.Exception
batchFinished
in class Filter
java.lang.IllegalStateException
- if no input structure has been defined
java.lang.NullPointerException
- if no input structure has been defined,
java.lang.Exception
- if there was a problem finishing the batch.public void setOptions(java.lang.String[] options) throws java.lang.Exception
-unset-class-temporarily Unsets the class index temporarily before the filter is applied to the data. (default: no)
-E <expression> Specify the expression to apply. Eg. pow(A,6)/(MEAN+MAX) Supported operators are +, -, *, /, pow, log, abs, cos, exp, sqrt, tan, sin, ceil, floor, rint, (, ), MEAN, MAX, MIN, SD, COUNT, SUM, SUMSQUARED, ifelse
-R <index1,index2-index4,...> Specify list of columns to ignore. First and last are valid indexes. (default none)
-V Invert matching sense (i.e. only modify specified columns)
setOptions
in interface OptionHandler
setOptions
in class PotentialClassIgnorer
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class PotentialClassIgnorer
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class PotentialClassIgnorer
public java.lang.String expressionTipText()
public void setExpression(java.lang.String expr)
expr
- a mathematical expression to applypublic java.lang.String getExpression()
public java.lang.String invertSelectionTipText()
public boolean getInvertSelection()
public void setInvertSelection(boolean invert)
invert
- the new invert settingpublic java.lang.String ignoreRangeTipText()
public java.lang.String getIgnoreRange()
public void setIgnoreRange(java.lang.String rangeList)
rangeList
- a string representing the list of attributes. Since
the string will typically come from a user, attributes are indexed from
1. public static void main(java.lang.String[] argv)
argv
- should contain arguments to the filter:
use -h for help
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |