Output Fields
PMML3.2 Menu


PMML Notice and License




General Structure










Built-in Functions

Model Composition

Model Verification

Association Rules








Text Models


Vector Machine

PMML 3.2 - Output fields

The output fields describe a set of result values that can be computed by the model. In particular, the output fields specify names and types and rules for selecting specific result features. This information can be used while writing an output table. The Output section in the model specifies default names for columns in an output table and describes how to compute the corresponding values.


    <OutputField name="P_responseYes" optype="continuous" datatype="xs:double" 
                 targetField="response" feature="probability" value="YES" />

    <OutputField name="P_responseNo" optype="continuous" datatype="xs:double"
                 targetField="response" feature="probability" value="NO" />

    <OutputField name="I_response" optype="categorical" datatype="xs:string" 
                 targetField="response" feature="predictedValue" />

    <OutputField name="U_response" optype="categorical" datatype="xs:string" 
                 targetField="response" feature="predictedDisplayValue" />

If a model contains this Output element a PMML consumer could map an input table to an output table with columns named P_responseYes, P_responseNo, etc. The values for P_responseYes are determined as the probability that the target field, with name response has the value YES.

The Schema is

  <xs:element name="Output">
        <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded" />
        <xs:element ref="OutputField" minOccurs="1" maxOccurs="unbounded" />

  <xs:element name="OutputField">
        <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded" />
      <xs:attribute name="name" type="FIELD-NAME" use="required" />
      <xs:attribute name="displayName" type="xs:string" />
      <xs:attribute name="optype" type="OPTYPE" />
      <xs:attribute name="dataType" type="DATATYPE"/>
      <xs:attribute name="targetField" type="FIELD-NAME" />
      <xs:attribute name="feature" type="RESULT-FEATURE" />
      <xs:attribute name="value" type="xs:string" />

  <xs:simpleType name="RESULT-FEATURE">      
     <xs:restriction base="xs:string">
        <xs:enumeration value="predictedValue" />
        <xs:enumeration value="predictedDisplayValue" />
        <xs:enumeration value="probability" />
        <xs:enumeration value="residual" />
        <xs:enumeration value="standardError" />
        <xs:enumeration value="clusterId" />
        <xs:enumeration value="clusterAffinity" />
        <xs:enumeration value="entityId" />
        <xs:enumeration value="entityAffinity" />
        <xs:enumeration value="warning" />

The value of attribute name specifies the name of a new field in the output. It can be any string. The name itself does not define how the output values are computed.

The attribute targetField must refer either to a MiningField of type predicted or to a Target in the Targets section. targetField is a required attribute in case the model predicts multiple fields. The attribute value contains the displayValue, if applicable.

If the attribute feature is not specified then the output value is a copy of the field value.

If the attribute feature is specified then targetField must refer to a target field, and the output value is computed from the mining result. If the attribute value is empty and the value of the attribute feature is probability then the probability of the resulting categorical value should be returned as an output. Otherwise, value indicates the category for which a probability is returned.

The meaning of the feature identifiers is:

predictedValue: Select the raw predicted value, aka target value. More than one OutputField element can have the predictedValue feature only if the model predicts more than one field.
predictedDisplayValue: Select the display value that corresponds to the raw predicted value. The display value can be specified in the element Target. If it is not specified explicitly, then the raw predicted value is used by default.
probability: Select the probability of the target value as given by the attribute value. The target value corresponds to, e.g., values in attribute targetCategory in element RegressionTable or values in attribute value in element ScoreDistribution for tree classification. That is, these values can be display values. The corresponding original values can be found in the Target elements. Attribute value in element Target matches value in OutputField, displayValue in Target is the original value.
residual: Select the residual of the target value. For numeric prediction this is the actual value minus the predicted value. For classification this is [actual value = target value] minus the predicted probability for the target value. The attribute value specifies the raw target value. The term [actual value = target value] is defined as 1.0 if the actual value is the same as the target value, and 0.0 otherwise.
standardError: Select the standard error of the predicted numeric value. In a regression model this value is computed as a square root of xVx where x is a vector of parameter coefficients based on the given predictors and V is the parameters covariance matrix.
clusterId: Indicates that this field is the ID of the predicted cluster.
clusterAffinity: clusterAffinity is the value of the distance or the similarity depending on the context of the clustering PMML document. Please note that a clustering PMML document producer may output the distance to the nearest center, instead of the cluster center. This specification supports only the distance to the cluster center given in clusterId, NOT the distance to the nearest center.
entityId: Similar to clusterId, indicates that the ID of the predicted cluster, tree node, neuron or rule. This is a more generalized feature than clusterID (which is only applicable to cluster models). For tree models, the id of the winning tree node is output; for Neural Networks, the id of the winning OutputNeuron is output; and for RuleSet models, the id of the rule that fired is output.
entityAffinity: entityAffinity is reserved for possible use in future versions of PMML.
warning: Any warning message such as too many missing values.

This table shows which outputs are allowed for each type of model defined in PMML. Please note that, as new scoring procedures are added in future releases of PMML, this table can change:

Allowable Outputs based on Model Type (ok = Valid Output, X = Not Applicable)
Model Type predicted
Display Value
probability residual standard
clusterId cluster
entityID entity
Association Rules X X X X X X X X X ok
Clustering Model ok ok X X X ok ok ok ok ok
GeneralRegression (regression) ok X X ok ok X X X X ok
GeneralRegression (classification) ok ok ok ok ok X X X X ok
Regression (regression) ok ok X ok ok X X X X ok
Regression (classification) ok ok ok ok ok X X X X ok
Naïve Bayes ok ok ok ok X X X X X ok
Neural Network (regression) ok ok X ok ok X X ok ok ok
Neural Network (classification) ok ok ok ok ok X X ok ok ok
RuleSet ok ok ok ok X X X ok ok ok
Sequence X X X X X X X X X ok
Support Vector Machine (regression) ok ok X ok ok X X X X ok
Support Vector Machine (classification) ok ok ok ok ok X X X X ok
Tree (regression) ok ok X ok X X X ok ok ok
Tree (classification) ok ok ok ok X X X ok ok ok

For Model Composition, the Output values should reflect those of the last model in the calculation.

Note that the feature identifier residual is useful only if the model is used on test data that contains target values.
It is straightforward to compute the residual on numeric data as the prediction error. The residual is based on differences of probability values in the case of categorical data.
For example, assume a classification model to predict the labels Y and N. For some row in the test data the actual value may be Y and the predicted value is Y with a probability of 0.8. The term [actual value = target value] maps to 1.0 and the residual is the difference between 1.0 and the probability, i.e. 1.0-0.8 = 0.2.
For some other row the actual value may be N. Assuming the predicted value and probability are the same as before we have [actual value = target value] = 0.0 and residual = 0.0 - 0.8 = -0.8.
e-mail info at dmg.org