public abstract class Expression extends Object implements Serializable
Constructor and Description |
---|
Expression(FieldMetaInfo.Optype opType,
ArrayList<Attribute> fieldDefs) |
Modifier and Type | Method and Description |
---|---|
static Expression |
getExpression(Node container,
FieldMetaInfo.Optype opType,
ArrayList<Attribute> fieldDefs,
weka.core.pmml.TransformationDictionary transDict)
Static factory method that returns a subclass of Expression that
encapsulates the type of expression contained in the Element
supplied.
|
static Expression |
getExpression(String name,
Node expression,
FieldMetaInfo.Optype opType,
ArrayList<Attribute> fieldDefs,
weka.core.pmml.TransformationDictionary transDict)
Static factory method that returns a subclass of Expression that
encapsulates the type of expression supplied as an argument.
|
Attribute |
getFieldDef(String attName)
Return the named attribute from the list of reference fields.
|
int |
getFieldDefIndex(String attName) |
FieldMetaInfo.Optype |
getOptype()
Get the optype of the result of applying this Expression.
|
abstract double |
getResult(double[] incoming)
Get the result of evaluating the expression.
|
abstract String |
getResultCategorical(double[] incoming)
Gets the result of evaluating the expression when the
optype is categorical or ordinal as the actual String
value.
|
double |
getResultContinuous(double[] incoming)
Get the result of evaluating the expression for continuous
optype.
|
void |
setFieldDefs(ArrayList<Attribute> fieldDefs)
Set the field definitions for this Expression to use
|
String |
toString() |
String |
toString(String pad) |
public Expression(FieldMetaInfo.Optype opType, ArrayList<Attribute> fieldDefs)
public void setFieldDefs(ArrayList<Attribute> fieldDefs) throws Exception
fieldDefs
- the field definitions to useException
- if there is a problem setting the field definitionspublic abstract double getResult(double[] incoming) throws Exception
incoming
- the incoming parameter valuesException
- if there is a problem computing the resultpublic double getResultContinuous(double[] incoming) throws Exception
incoming
- the incoming parameter values
mining schemaException
- if the optype is not continuous.public abstract String getResultCategorical(double[] incoming) throws Exception
incoming
- the incoming parameter valuesException
- if the optype is continuouspublic static Expression getExpression(Node container, FieldMetaInfo.Optype opType, ArrayList<Attribute> fieldDefs, weka.core.pmml.TransformationDictionary transDict) throws Exception
container
- the Node containing the expressionopType
- the optype of the value returned by this Expression.fieldDefs
- an ArrayList of Attributes for the fields that this
Expression may need to access
Since Expressions are children of either DerivedFields or
DefineFuntions, they will have the same optype as their parent.transDict
- the TransformationDictionary (may be null if there
is no dictionary)Exception
- for unsupported Expression typespublic static Expression getExpression(String name, Node expression, FieldMetaInfo.Optype opType, ArrayList<Attribute> fieldDefs, weka.core.pmml.TransformationDictionary transDict) throws Exception
name
- the name of the Expression to getexpression
- the Node containing the expressionopType
- the optype of the value returned by this Expression.fieldDefs
- an ArrayList of Attributes for the fields that this
Expression may need to access
Since Expressions are children of either DerivedFields or
DefineFuntions, they will have the same optype as their parent.transDict
- the TransformationDictionary (may be null if there
is no dictionary)Exception
- for unsupported Expression typespublic Attribute getFieldDef(String attName)
attName
- the name of the attribute to retrievepublic int getFieldDefIndex(String attName)
public FieldMetaInfo.Optype getOptype()
Copyright © 2019 University of Waikato, Hamilton, NZ. All rights reserved.