public class AddExpression extends Filter implements UnsupervisedFilter, StreamableFilter, OptionHandler
-E <expression> Specify the expression to apply. Eg a1^2*a5/log(a7*4.0). Supported opperators: ,+, -, *, /, ^, log, abs, cos, exp, sqrt, floor, ceil, rint, tan, sin, (, ) (default: a1^2)
-N <name> Specify the name for the new attribute. (default is the expression provided with -E)
-D Debug. Names attribute with the postfix parse of the expression.
| Constructor and Description |
|---|
AddExpression() |
| Modifier and Type | Method and Description |
|---|---|
String |
debugTipText()
Returns the tip text for this property
|
String |
expressionTipText()
Returns the tip text for this property
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
boolean |
getDebug()
Gets whether debug is set
|
String |
getExpression()
Get the expression
|
String |
getName()
Returns the name of the new attribute
|
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<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] args)
Main method for testing this class.
|
String |
nameTipText()
Returns the tip text for this property
|
void |
setDebug(boolean d)
Set debug mode.
|
void |
setExpression(String expr)
Set the expression to apply
|
boolean |
setInputFormat(Instances instanceInfo)
Sets the format of the input instances.
|
void |
setName(String name)
Set the name for the new attribute.
|
void |
setOptions(String[] options)
Parses a given list of options.
|
batchFilterFile, batchFinished, filterFile, getCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, runFilter, toString, useFilter, wekaStaticWrapperpublic String globalInfo()
public Enumeration<Option> listOptions()
listOptions in interface OptionHandlerpublic void setOptions(String[] options) throws Exception
-E <expression> Specify the expression to apply. Eg a1^2*a5/log(a7*4.0). Supported opperators: ,+, -, *, /, ^, log, abs, cos, exp, sqrt, floor, ceil, rint, tan, sin, (, ) (default: a1^2)
-N <name> Specify the name for the new attribute. (default is the expression provided with -E)
-D Debug. Names attribute with the postfix parse of the expression.
setOptions in interface OptionHandleroptions - the list of options as an array of stringsException - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlerpublic String nameTipText()
public void setName(String name)
name - the name of the new attributepublic String getName()
public String debugTipText()
public void setDebug(boolean d)
d - true if debug mode is to be usedpublic boolean getDebug()
public String expressionTipText()
public void setExpression(String expr)
expr - a mathematical expression to applypublic String getExpression()
public Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class FilterCapabilitiespublic boolean setInputFormat(Instances instanceInfo) throws Exception
setInputFormat in class FilterinstanceInfo - an Instances object containing the input instance
structure (any instances contained in the object are ignored -
only the structure is required).Exception - if the format couldn't be set successfullypublic boolean input(Instance instance) throws Exception
input in class Filterinstance - the input instanceIllegalStateException - if no input format has been defined.Exception - if there was a problem during the filtering.public String getRevision()
getRevision in interface RevisionHandlergetRevision in class Filterpublic static void main(String[] args)
args - should contain arguments to the filter: use -h for helpCopyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.