2.0 - PMMLPredict Example: Populated Prediction Column - Teradata Vantage

Teradata Vantageā„¢ - Bring Your Own Model User Guide

Product
Teradata Vantage
Release Number
2.0
Release Date
October 2021
Content Type
User Guide
Publication ID
B700-1111-051K
Language
English (United States)

This example shows a table created from a PMMLPredict call that has a populated prediction column.

SELECT * FROM mldb.PMMLPredict (
  ON iris_data
  ON (SELECT * FROM pmml_models where model_id='rf_iris') DIMENSION
  USING
    Accumulate ('id')
) AS td;
id prediction json_report
-- ---------- -------------------------------------------------------------------------------------
 9     2      {"probability_0":0.0,"probability_1":0.33,"predicted_Species":2,"probability_2":0.67}
10     2      {"probability_0":0.0,"probability_1":0.38,"predicted_Species":2,"probability_2":0.62}
 7     2      {"probability_0":0.0,"probability_1":0.33,"predicted_Species":2,"probability_2":0.67}
 5     2      {"probability_0":0.0,"probability_1":0.05,"predicted_Species":2,"probability_2":0.95}
 3     2      {"probability_0":0.0,"probability_1":0.05,"predicted_Species":2,"probability_2":0.95}
 1     2      {"probability_0":0.0,"probability_1":0.05,"predicted_Species":2,"probability_2":0.95}
 8     2      {"probability_0":0.0,"probability_1":0.33,"predicted_Species":2,"probability_2":0.67}
 6     2      {"probability_0":0.0,"probability_1":0.05,"predicted_Species":2,"probability_2":0.95}
 4     2      {"probability_0":0.0,"probability_1":0.05,"predicted_Species":2,"probability_2":0.95}
 2     2      {"probability_0":0.0,"probability_1":0.05,"predicted_Species":2,"probability_2":0.95}

The prediction column value is the predicted_species value in the json_report column.