Example: How to Use BYOM Scoring Model with Teradataml Widgets - Example: How to Use BYOM Scoring Model with Teradataml Widgets - Teradata VantageCloud Lake

Lake - Analyze Your Data with ClearScape Analytics™

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2026-02-20
dita:mapPath
tcl1683670667798.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
tcl1683670667798

    Load data and DataFrame objects

  1. Import the required libraries and functions to call teradataml code before using teradatamlwidgets.
    import os, teradataml
    from teradataml import get_connection, DataFrame
    from teradataml import save_byom, retrieve_byom, load_example_data
    from teradataml import configure, display_analytic_functions, execute_sql
  2. Load the example data.
    load_example_data("byom", "iris_test")
  3. Create the teradataml DataFrame objects.
    iris_test = DataFrame.from_table("iris_test")
  4. Load model into Vantage

  5. Load the model file into Vantage.
    model_file = os.path.join(os.path.dirname(teradataml.__file__), "data", 
                           "models", "dr_iris_rf"
    try:
       save_byom("dr_iris_rf", model_file, "byom_model")
    except:
       pass
  6. Set the parameters

  7. Set the parameters:
    1. Set Function to DataRobotPredict.
    2. Set BYOM Install to mldb.
    3. Set InputTable to iris_test.
    4. Set ModelID to dr_iris_rf.
    5. Set ModelTable to byom_models.
    6. Set Accumulate to sepal_length, petal_length, petal_width.
    7. Set OverwriteCachedModel to *.

    Teradataml Widgets - BYOM function example parameters
  8. Select Execute.

    Teradataml Widgets - BYOM function example output