Teradata Package for Python Function Reference | 17.10 - delete_byom - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.
Teradata® Package for Python Function Reference
- Product
- Teradata Package for Python
- Release Number
- 17.10
- Published
- April 2022
- Language
- English (United States)
- Last Update
- 2022-08-19
- lifecycle
- previous
- Product Category
- Teradata Vantage
- teradataml.catalog.byom.delete_byom = delete_byom(model_id, table_name=None, schema_name=None)
- DESCRIPTION:
Delete a model from the user specified table in Teradata Vantage.
PARAMETERS:
model_id:
Required Argument.
Specifies the the unique model identifier of the model to be deleted.
Types: str
table_name:
Optional Argument.
Specifies the name of the table to delete the model from.
Notes:
* One must either specify this argument or set the byom model catalog table
name using set_byom_catalog().
* If none of these arguments are set, exception is raised; If both arguments
are set, the settings in delete_byom() take precedence and is used for
function execution when saving an model.
Types: str
schema_name:
Optional Argument.
Specifies the name of the schema/database in which the table specified in
"table_name" is looked up.
Notes:
* One must either specify this argument and table_name argument
or set the byom model catalog schema and table name using set_byom_catalog().
* If none of these arguments are set, exception is raised; If both arguments
are set, the settings in delete_byom() take precedence and is used for
function execution when saving an model.
* If user specifies schema_name argument table_name argument has to be specified,
else exception is raised.
Types: str
RETURNS:
None.
RAISES:
TeradataMlException
EXAMPLES:
>>> import teradataml, os, datetime
>>> model_file = os.path.join(os.path.dirname(teradataml.__file__), 'data', 'models', 'iris_kmeans_model')
>>> from teradataml import save_byom, delete_byom
>>> save_byom('model3', model_file, 'byom_models')
Model is saved.
>>> save_byom('model4', model_file, 'byom_models', schema_name='test')
Model is saved.
>>> save_byom('model5', model_file, 'byom_models', schema_name='test')
Model is saved.
>>> save_byom('model4', model_file, 'byom_models')
Model is saved.
>>> save_byom('model5', model_file, 'byom_models')
Model is saved.
# Example 1 - Delete 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 id 'model4' from the table byom_models
# and the table is in "test" DataBase.
>>> delete_byom(model_id='model4', table_name='byom_models', schema_name='test')
Model is deleted.
>>>
# Example 3 - Delete a model with id 'model4' from the model cataloging table 'byom_models'
# set by set_byom_catalog().
>>> set_byom_catalog(table_name='byom_models', schema_name='alice')
The model cataloging parameters are set to table_name='byom_models' and schema_name='alice'
>>> delete_byom(model_id='model4')
Model is deleted.
# Example 4 - Set the cataloging table_name to 'byom_models'
# and delete the model in table other than model catalog table 'byom_licensed_models'.
>>> set_byom_catalog(table_name='byom_models', schema_name= alice')
The model cataloging parameters are set to table_name='byom_models' and schema_name='alice'
>>> save_byom('licensed_model2', model_file=model_file, table_name='byom_licensed_models')
Created the model table 'byom_licensed_models' as it does not exist.
Model is saved.
>>> delete_byom(model_id='licensed_model2', table_name='byom_licensed_models')
Model is deleted.