weka.core.pmml
Class NormContinuous

java.lang.Object
  extended by weka.core.pmml.Expression
      extended by weka.core.pmml.NormContinuous
All Implemented Interfaces:
Serializable

public class NormContinuous
extends Expression

Class encapsulating a NormContinuous Expression.

Version:
$Revision 1.0 $
Author:
Mark Hall (mhall{[at]}pentaho{[dot]}com)
See Also:
Serialized Form

Constructor Summary
NormContinuous(Element normCont, FieldMetaInfo.Optype opType, ArrayList<Attribute> fieldDefs)
           
 
Method Summary
 double getResult(double[] incoming)
          Get the result of evaluating the expression.
 String getResultCategorical(double[] incoming)
          Always throws an Exception since the result of NormContinuous must be continuous.
 double getResultInverse(double[] incoming)
          Compute the inverse of the normalization (i.e.
 void setFieldDefs(ArrayList<Attribute> fieldDefs)
          Set the field definitions for this Expression to use
 String toString(String pad)
           
 
Methods inherited from class weka.core.pmml.Expression
getExpression, getExpression, getFieldDef, getFieldDefIndex, getOptype, getResultContinuous, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NormContinuous

public NormContinuous(Element normCont,
                      FieldMetaInfo.Optype opType,
                      ArrayList<Attribute> fieldDefs)
               throws Exception
Throws:
Exception
Method Detail

setFieldDefs

public void setFieldDefs(ArrayList<Attribute> fieldDefs)
                  throws Exception
Set the field definitions for this Expression to use

Overrides:
setFieldDefs in class Expression
Parameters:
fieldDefs - the field definitions to use
Throws:
Exception - if there is a problem setting the field definitions

getResult

public 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.

Specified by:
getResult in class Expression
Parameters:
incoming - the incoming parameter values
Returns:
the result of normalizing the input field
Throws:
Exception - if there is a problem computing the result

getResultInverse

public double getResultInverse(double[] incoming)
Compute the inverse of the normalization (i.e. map back to a unormalized value).

Parameters:
incoming - the incoming parameter values
Returns:
the unormalized value

getResultCategorical

public String getResultCategorical(double[] incoming)
                            throws Exception
Always throws an Exception since the result of NormContinuous must be continuous.

Specified by:
getResultCategorical in class Expression
Parameters:
incoming - the incoming parameter values
Returns:
the result of evaluating the expression
Throws:
Exception - always

toString

public String toString(String pad)
Overrides:
toString in class Expression


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.