delete_byom() | Teradata Package for Python - 17.00 - delete_byom() - Teradata Package for Python

Teradata® Package for Python User Guide

Product
Teradata Package for Python
Release Number
17.00
Release Date
November 2021
Content Type
User Guide
Publication ID
B700-4006-070K
Language
English (United States)

The delete_byom() API allows a user to delete a model from the user specified table in Vantage.

Required Arguments:
  • model_id specifies the unique model identifier of the model to be deleted.
  • table_name specifies the name of the table to delete the model from.
Optional Argument:
  • schema_name specifies the name of the schema in which the table specified in table_name is looked up.

    If not specified, then table is looked up in the current schema.

Example Setup

  • Import necessary modules.
    >>> import teradataml, os, datetime
    >>> # importing delete_byom from teradataml
    >>> from teradataml from teradataml import save_byom, delete_byom
  • Get the model file path to use it in examples.
    >>> model_file = os.path.join(os.path.dirname(teradataml.__file__), "data", "models", "iris_kmeans_model")
  • Save some models with different parameters.
    >>> save_byom("model3", model_file, "byom_models")
    Model is saved.
    >>> save_byom("model4", model_file, "byom_models", schema_name="test")
    Model is saved.

Example 1: Delete a model with specific model_id from a specific table

This example deletes a model with id "model3" from the table "byom_models".

>>> delete_byom(model_id="model3", table_name="byom_models")
Model is deleted.

Example 2: Delete a model with specific model_id from a specific table in a specific database

This example deletes a model with id "model4" from the table "byom_models" is in the "test" database.

>>> delete_byom(model_id="model4", table_name="byom_models", schema_name="test")
Model is deleted.