Package weka.core.pmml
Class BuiltInMath
java.lang.Object
weka.core.pmml.Function
weka.core.pmml.BuiltInMath
- All Implemented Interfaces:
Serializable
Built-in function for min, max, sum, avg, log10,
ln, sqrt, abs, exp, pow, threshold, floor, ceil and round.
- Version:
- $Revision 1.0 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
-
Constructor Summary
ConstructorDescriptionBuiltInMath
(weka.core.pmml.BuiltInMath.MathFunc func) Construct a new built-in pmml Math function. -
Method Summary
Modifier and TypeMethodDescriptionGet the structure of the result produced by this function.String[]
Returns an array of the names of the parameters expected as input by this function.double
getResult
(double[] incoming) Get the result of applying this function.void
setParameterDefs
(ArrayList<Attribute> paramDefs) Set the structure of the parameters that are expected as input by this function.toString()
Methods inherited from class weka.core.pmml.Function
getFunction, getFunction, getName, toString
-
Constructor Details
-
BuiltInMath
public BuiltInMath(weka.core.pmml.BuiltInMath.MathFunc func) Construct a new built-in pmml Math function.- Parameters:
func
- the math function to use
-
-
Method Details
-
setParameterDefs
Set the structure of the parameters that are expected as input by this function. This must be called before getOutputDef() is called.- Specified by:
setParameterDefs
in classFunction
- Parameters:
paramDefs
- the structure of the input parameters- Throws:
Exception
- if the number or types of parameters are not acceptable by this function
-
getOutputDef
Get the structure of the result produced by this function. Subclasses must implement.- Specified by:
getOutputDef
in classFunction
- Returns:
- the structure of the result produced by this function.
-
getParameterNames
Returns an array of the names of the parameters expected as input by this function. May return null if the function can accept an unbounded number of arguments.- Specified by:
getParameterNames
in classFunction
- Returns:
- an array of the parameter names (or null if the function can accept any number of arguments).
-
getResult
Get the result of applying this function.- Specified by:
getResult
in classFunction
- Parameters:
incoming
- the arguments to this function (supplied in order to match that of the parameter definitions- Returns:
- the result of applying this function. When the optype is categorical or ordinal, an index into the values of the output definition is returned.
- Throws:
Exception
- if there is a problem computing the result of this function
-
toString
-