Package weka.core.pmml
Class NormDiscrete
java.lang.Object
weka.core.pmml.Expression
weka.core.pmml.NormDiscrete
- All Implemented Interfaces:
Serializable
Class encapsulating a NormDiscrete Expression. Creates an
indicator for a particular discrete value.
- Version:
- $Revision 1.0 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
-
Constructor Summary
ConstructorDescriptionNormDiscrete
(Element normDisc, FieldMetaInfo.Optype opType, ArrayList<Attribute> fieldDefs) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getResult
(double[] incoming) Get the result of evaluating the expression.getResultCategorical
(double[] incoming) Always throws an Exception since the result of NormDiscrete must be continuous.void
setFieldDefs
(ArrayList<Attribute> fieldDefs) Set the field definitions for this Expression to useMethods inherited from class weka.core.pmml.Expression
getExpression, getExpression, getFieldDef, getFieldDefIndex, getOptype, getResultContinuous, toString
-
Constructor Details
-
NormDiscrete
public NormDiscrete(Element normDisc, FieldMetaInfo.Optype opType, ArrayList<Attribute> fieldDefs) throws Exception Constructor. Reads the field name and field value for this NormDiscrete Expression.- Parameters:
normDisc
- the Element encapsulating this NormDiscreteopType
- the optype for this expression (taken from either the enclosing DefineFunction or DerivedField)fieldDefs
- an ArrayList of Attributes for the fields that this Expression might need to access enclosing DefineFunction or DerivedField)- Throws:
Exception
- if there is a problem parsing this Apply Expression
-
-
Method Details
-
setFieldDefs
Set the field definitions for this Expression to use- Overrides:
setFieldDefs
in classExpression
- Parameters:
fieldDefs
- the field definitions to use- Throws:
Exception
- if there is a problem setting the field definitions
-
getResult
Get the result of evaluating the expression. In the case of a continuous optype, a real number is returned; in the case of a categorical/ordinal optype, the index of the nominal value is returned as a double.- Specified by:
getResult
in classExpression
- Parameters:
incoming
- the incoming parameter values- Returns:
- the result of evaluating the expression
- Throws:
Exception
- if there is a problem computing the result
-
getResultCategorical
Always throws an Exception since the result of NormDiscrete must be continuous.- Specified by:
getResultCategorical
in classExpression
- Parameters:
incoming
- the incoming parameter values- Returns:
- the result of evaluating the expression
- Throws:
Exception
- always
-
toString
- Overrides:
toString
in classExpression
-