Teradata Package for Python Function Reference - list_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.00
- Published
- November 2021
- Language
- English (United States)
- Last Update
- 2021-11-19
- lifecycle
- previous
- Product Category
- Teradata Vantage
- teradataml.catalog.byom.list_byom = list_byom(table_name, schema_name=None, model_id=None)
- DESCRIPTION:
Function to list models.
PARAMETERS:
table_name:
Required Argument.
Specifies the name of the table to list models from.
Types: str
schema_name:
Optional Argument.
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 current schema.
Types: str
model_id:
Optional Argument.
Specifies the unique model identifier of the model(s). If specified,
the models with either exact match or a substring match, are listed.
Types: str OR list
RETURNS:
None.
RAISES:
TeradataMlException, TypeError
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, list_byom
>>> save_byom('model7', model_file, 'byom_models')
Model is saved.
>>> save_byom('iris_model1', model_file, 'byom_models')
Model is saved.
>>> save_byom('model8', model_file, 'byom_models', schema_name='test')
Model is saved.
>>>
# Example 1 - List all the models from the table byom_models.
>>> list_byom(table_name='byom_models')
model
model_id
model7 b'504B03041400080808...'
iris_model1 b'504B03041400080808...'
>>>
# Example 2 - List all the models with model_id containing 'iris' string.
# List such models from 'byom_models' table.
>>> list_byom(table_name='byom_models', model_id='iris')
model
model_id
iris_model1 b'504B03041400080808...'
>>>
# Example 3 - List all the models with model_id containing either 'iris'
# or '7'. List such models from 'byom_models' table.
>>> list_byom(table_name='byom_models', model_id=['iris', '7'])
model
model_id
model7 b'504B03041400080808...'
iris_model1 b'504B03041400080808...'
>>>
# Example 4 - List all the models from the 'byom_models' table and table is
# in 'test' DataBase.
>>> list_byom(table_name='byom_models', schema_name='test')
model
model_id
model8 b'504B03041400080808...'
>>>