程序包 weka.core.pmml

类 Expression

java.lang.Object
weka.core.pmml.Expression
所有已实现的接口:
Serializable
直接已知子类:
Constant, Discretize, FieldRef, NormContinuous, NormDiscrete

public abstract class Expression extends Object implements Serializable
另请参阅:
  • 构造器详细资料

  • 方法详细资料

    • setFieldDefs

      public void setFieldDefs(ArrayList<Attribute> fieldDefs) throws Exception
      Set the field definitions for this Expression to use
      参数:
      fieldDefs - the field definitions to use
      抛出:
      Exception - if there is a problem setting the field definitions
    • getResult

      public abstract double getResult(double[] incoming) throws Exception
      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.
      参数:
      incoming - the incoming parameter values
      返回:
      the result of evaluating the expression
      抛出:
      Exception - if there is a problem computing the result
    • getResultContinuous

      public double getResultContinuous(double[] incoming) throws Exception
      Get the result of evaluating the expression for continuous optype. Is the same as calling getResult() when the optype is continuous.
      参数:
      incoming - the incoming parameter values mining schema
      返回:
      the result of evaluating the expression.
      抛出:
      Exception - if the optype is not continuous.
    • getResultCategorical

      public abstract String getResultCategorical(double[] incoming) throws Exception
      Gets the result of evaluating the expression when the optype is categorical or ordinal as the actual String value.
      参数:
      incoming - the incoming parameter values
      返回:
      the result of evaluating the expression
      抛出:
      Exception - if the optype is continuous
    • getExpression

      public static Expression getExpression(Node container, FieldMetaInfo.Optype opType, ArrayList<Attribute> fieldDefs, weka.core.pmml.TransformationDictionary transDict) throws Exception
      Static factory method that returns a subclass of Expression that encapsulates the type of expression contained in the Element supplied. Assumes that there is just one expression contained in the supplied Element.
      参数:
      container - the Node containing the expression
      opType - 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)
      返回:
      an Expression object or null if there is no known expression in the container
      抛出:
      Exception - for unsupported Expression types
    • getExpression

      public static Expression getExpression(String name, Node expression, FieldMetaInfo.Optype opType, ArrayList<Attribute> fieldDefs, weka.core.pmml.TransformationDictionary transDict) throws Exception
      Static factory method that returns a subclass of Expression that encapsulates the type of expression supplied as an argument.
      参数:
      name - the name of the Expression to get
      expression - the Node containing the expression
      opType - 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)
      返回:
      an Expression object or null if there is no known expression in the container
      抛出:
      Exception - for unsupported Expression types
    • getFieldDef

      public Attribute getFieldDef(String attName)
      Return the named attribute from the list of reference fields.
      参数:
      attName - the name of the attribute to retrieve
      返回:
      the named attribute (or null if it can't be found).
    • getFieldDefIndex

      public int getFieldDefIndex(String attName)
    • getOptype

      public FieldMetaInfo.Optype getOptype()
      Get the optype of the result of applying this Expression.
      返回:
      the optype of the result of applying this Expression
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • toString

      public String toString(String pad)