Operationalize Your Model | Teradata Vantage Trial - Operationalizing Your Model - Vantage Trial

Teradata Vantageā„¢ Trial Quick Start Guide

Product
Vantage Trial
Release Number
2.7
Publication Date
August 2022
Last update
2022-08-04
Content Type
User Guide
Publication ID
B035-2820-121K
ft:locale
en-US
ft:lastEdition
2022-08-04
dita:mapPath
jzh1567636979792.ditamap
dita:ditavalPath
pnw1578847806387.ditaval
ft:sourceId
dita
dita:id
B035-2820
Important: Use JupyterHub to load your own predictive model data into a Vantage table. A PMML model must be stored in a BLOB datatype column. Vantage Trial does not support uploading BLOB data type in Editor and does not support BTEQ or Teradata Studio.
  1. Convert your model to PMML.
  2. From your site page, select Launch Apps > JupyterHub.
  3. Create a folder in JupyterHub for your model and upload your PMML file into the folder.
  4. Create a new Python notebook in the same folder.
  5. From the notebook, load the model into a Vantage table using the following code.
    import teradataml as tdml
    import tdconnect
     
    tdconnect.create_context('Vantage')
    model_bytes = open("sample_model.xml", "rb").read()
    with tdml.get_connection() as conn:
        conn.execute("insert into PMML_MODELS_TABLE_NAME values ('sample_model_id', ?)", model_bytes)
  6. Call the BYOM Predict function to score the model.