|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.tools.math.function.ExpressionParser
public class ExpressionParser
This class can be used as expression parser in order to generate new attributes. The parser constructs new attributes from the attributes of the input example set.
The following operators are supported:
The following log and exponential functions are supported:
The following trigonometric functions are supported:
The following statistical functions are supported:
The following miscellaneous functions are supported:
The following miscellaneous functions are supported:
Beside those operators and functions, this operator also supports the constants pi and e if this is indicated by the corresponding parameter (default: true). You can also use strings in formulas (for example in a conditioned if-formula) but the string values have to be enclosed in double quotes.
Please note that there are some restrictions for the attribute names in order to let this operator work properly:
ChangeAttributeName operator.
Examples:
a1+sin(a2*a3)
if (att1>5, att2*att3, -abs(att1))
| Constructor Summary | |
|---|---|
ExpressionParser(boolean useStandardConstants)
|
|
ExpressionParser(boolean useStandardConstants,
Process process)
This constructor allows additional functions if called within a process. |
|
| Method Summary | |
|---|---|
void |
addAttribute(ExampleSet exampleSet,
java.lang.String name,
java.lang.String function)
Iterates over the ExampleSet, interprets attributes as variables, evaluates
the function and creates a new attribute with the given name that takes the expression's value. |
void |
addMacro(MacroHandler macroHandler,
java.lang.String name,
java.lang.String function)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExpressionParser(boolean useStandardConstants)
public ExpressionParser(boolean useStandardConstants,
Process process)
| Method Detail |
|---|
public void addMacro(MacroHandler macroHandler,
java.lang.String name,
java.lang.String function)
throws GenerationException
GenerationException
public void addAttribute(ExampleSet exampleSet,
java.lang.String name,
java.lang.String function)
throws GenerationException
ExampleSet, interprets attributes as variables, evaluates
the function and creates a new attribute with the given name that takes the expression's value.
The type of the attribute depends on the expression type and is Ontology.NOMINAL for strings,
Ontology.NUMERICAL for reals and complex numbers and Ontology.BINOMINAL with values
"true" and "false" for booleans.
GenerationException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||