PMMLPredict Examples | BYOM | Teradata Vantage - 2.0 - PMMLPredict Example: Specify Model in WHERE Clause - 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)

Suppose ModelTable pmml_models has three models.

SELECT * FROM pmml_models;
model_id                       model
------------------------------ --------------------------------------------
iris_db_rf_model               3C3F786D6C2076657273696F6E3D22312E302220656E
iris_db_naive_bayes_model      3C3F786D6C2076657273696F6E3D22312E302220656E
rf_iris                        3C3F786D6C2076657273696F6E3D22312E302220656E

The preceding BTEQ output displays the model column with the default output width (75 characters). The displayed content is from the header, which is the same for each PMML XML model.

The model identifier of the model to score must appear in a WHERE clause in the PMMLPredict call.

SELECT * FROM mldb.PMMLPredict (
    ON iris_data AS InputTable
    ON (SELECT * FROM pmml_models WHERE model_id='rf_iris') AS ModelTable DIMENSION
    USING
      Accumulate ('id')
) AS td;