PMMLPredict Examples | BYOM | Teradata Vantage - PMMLPredict Example: Specify Model in WHERE Clause - Teradata Vantage

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

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Teradata Vantage
Release Number
5.0
Published
October 2023
Language
English (United States)
Last Update
2024-04-06
dita:mapPath
fee1607120608274.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
fee1607120608274

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;