weka.core.pmml
Class BuiltInArithmetic
- java.lang.Object
-
- weka.core.pmml.Function
-
- weka.core.pmml.BuiltInArithmetic
-
- All Implemented Interfaces:
- java.io.Serializable
public class BuiltInArithmetic extends Function
Built-in function for +, -, *, /.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BuiltInArithmetic(weka.core.pmml.BuiltInArithmetic.Operator op)Construct a new Arithmetic built-in pmml function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AttributegetOutputDef()Get the structure of the result produced by this function.java.lang.String[]getParameterNames()Returns an array of the names of the parameters expected as input by this functiondoublegetResult(double[] incoming)Get the result of applying this function.voidsetParameterDefs(java.util.ArrayList<Attribute> paramDefs)Set the structure of the parameters that are expected as input by this function.java.lang.StringtoString()java.lang.StringtoString(java.lang.String pad)-
Methods inherited from class weka.core.pmml.Function
getFunction, getFunction, getName
-
-
-
-
Constructor Detail
-
BuiltInArithmetic
public BuiltInArithmetic(weka.core.pmml.BuiltInArithmetic.Operator op)
Construct a new Arithmetic built-in pmml function.- Parameters:
op- the operator to use.
-
-
Method Detail
-
setParameterDefs
public void setParameterDefs(java.util.ArrayList<Attribute> paramDefs) throws java.lang.Exception
Set the structure of the parameters that are expected as input by this function. This must be called before getOutputDef() is called.- Specified by:
setParameterDefsin classFunction- Parameters:
paramDefs- the structure of the input parameters- Throws:
java.lang.Exception- if the number or types of parameters are not acceptable by this function
-
getParameterNames
public java.lang.String[] getParameterNames()
Returns an array of the names of the parameters expected as input by this function- Specified by:
getParameterNamesin classFunction- Returns:
- an array of the parameter names
-
getOutputDef
public Attribute getOutputDef()
Get the structure of the result produced by this function. Subclasses must implement.- Specified by:
getOutputDefin classFunction- Returns:
- the structure of the result produced by this function.
-
getResult
public double getResult(double[] incoming) throws java.lang.ExceptionGet the result of applying this function.- Specified by:
getResultin 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:
java.lang.Exception- if there is a problem computing the result of this function
-
-
DataMelt 3.0 © DataMelt by jWork.ORG