|
||||||||||
| 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. The 'A' letter refers to the value of the attribute being processed. Other attribute values (numeric only) can be accessed through the variables A1, A2, A3, ...
-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 Form| Field Summary | |
|---|---|
static 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. |
String |
expressionTipText()
Returns the tip text for this property |
Capabilities |
getCapabilities()
Returns the Capabilities of this filter. |
String |
getExpression()
Get the expression |
String |
getIgnoreRange()
Get the current range selection. |
boolean |
getInvertSelection()
Get whether the supplied columns are to be select or unselect |
String[] |
getOptions()
Gets the current settings of the filter. |
String |
getRevision()
Returns the revision string. |
String |
globalInfo()
Returns a string describing this filter |
String |
ignoreRangeTipText()
Returns the tip text for this property |
boolean |
input(Instance instance)
Input an instance for filtering. |
String |
invertSelectionTipText()
Returns the tip text for this property |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(String[] argv)
Main method for testing this class. |
void |
setExpression(String expr)
Set the expression to apply |
void |
setIgnoreRange(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(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, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, runFilter, toString, useFilter, wekaStaticWrapper |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String m_defaultExpression
| Constructor Detail |
|---|
public MathExpression()
| Method Detail |
|---|
public String globalInfo()
public Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class FilterCapabilities
public boolean setInputFormat(Instances instanceInfo)
throws Exception
setInputFormat in class PotentialClassIgnorerinstanceInfo - an Instances object containing the input
instance structure (any instances contained in the object are
ignored - only the structure is required).
Exception - if the input format can't be set
successfully
public boolean input(Instance instance)
throws Exception
input in class Filterinstance - the input instance
IllegalStateException - if no input format has been set.
NullPointerException - if the input format has not been
defined.
Exception - if the input instance was not of the correct
format or if there was a problem with the filtering.
public boolean batchFinished()
throws Exception
batchFinished in class FilterIllegalStateException - if no input structure has been defined
NullPointerException - if no input structure has been defined,
Exception - if there was a problem finishing the batch.
public void setOptions(String[] options)
throws 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. The 'A' letter refers to the value of the attribute being processed. Other attribute values (numeric only) can be accessed through the variables A1, A2, A3, ...
-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 OptionHandlersetOptions in class PotentialClassIgnoreroptions - the list of options as an array of strings
Exception - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlergetOptions in class PotentialClassIgnorerpublic Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class PotentialClassIgnorerpublic String expressionTipText()
public void setExpression(String expr)
expr - a mathematical expression to applypublic String getExpression()
public String invertSelectionTipText()
public boolean getInvertSelection()
public void setInvertSelection(boolean invert)
invert - the new invert settingpublic String ignoreRangeTipText()
public String getIgnoreRange()
public void setIgnoreRange(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 String getRevision()
getRevision in interface RevisionHandlergetRevision in class Filterpublic static void main(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 | |||||||||