list_models() | Teradata Python Package - list_models() - Teradata Package for Python

Teradata® Package for Python User Guide

Product
Teradata Package for Python
Release Number
17.00
Published
November 2021
Language
English (United States)
Last Update
2022-01-14
dita:mapPath
bol1585763678431.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
B700-4006
lifecycle
previous
Product Category
Teradata Vantage
The list_models() function provides the user with the ability to list all models that are accessible to the user, filtering the results based on the following optional arguments:
  • The model name - using the argument name;
  • The name of the algorithm that was used to generate the model - using the argument algorithm_name;
  • The model generating engine - using the argument engine;
  • Flag to list models created by or accessible to the user - using the argument accessible:
    • If True, all models to which the user has access are listed.
    • If False, all models created by the user are listed.
  • Flag to list models with the access level set to PUBLIC - using the argument public.

    See the publish_model() section for more details on this argument.

A user can only see the models that he or she has access to.

Example Prerequisites

Follow the steps in save_model() to create a classification tree model that can be input to DecisionForestPredict and save the generated model.

Example: List all models saved and accessible to the current user.

>>> list_models()
               ModelName  ModelAlgorithm ModelGeneratingEngine ModelGeneratingClient CreatedBy                 CreatedDate
0  decision_forest_model  DecisionForest             ML Engine            teradataml     ALICE  2020-05-17 23:59:48.740000

Example: List models accessible to the user with name = 'decision_forest_model'.

You can pass a substring as well.

>>> list_models(name = "decision_forest_model")
               ModelName  ModelAlgorithm ModelGeneratingEngine ModelGeneratingClient CreatedBy                 CreatedDate
0  decision_forest_model  DecisionForest             ML Engine            teradataml     ALICE  2020-05-17 23:59:48.740000

Example: List all models accessible to the user, with specific algorithm name.

This example lists all models accessible to the user with algorithm name 'DecisionForest'. You can pass a substring as well.

>>> list_models(algorithm_name = "DecisionForest")
               ModelName  ModelAlgorithm ModelGeneratingEngine ModelGeneratingClient CreatedBy                 CreatedDate
0  decision_forest_model  DecisionForest             ML Engine            teradataml     ALICE  2020-05-17 23:59:48.740000

Example: List all models accessible to user, with specific algorithm name and model name.

This example lists all models accessible to user with algorithm name 'DecisionForest' and model name containing string 'forest'.

>>> list_models(name = "forest", algorithm_name = "DecisionForest")
               ModelName  ModelAlgorithm ModelGeneratingEngine ModelGeneratingClient CreatedBy                 CreatedDate
0  decision_forest_model  DecisionForest             ML Engine            teradataml     ALICE  2020-05-17 23:59:48.740000

Example: List all models accessible to user, with specific algorithm name and engine name.

This example lists all models accessible to user with algorithm name 'DecisionForest' and model generated using 'ML Engine'.

>>> list_models(algorithm_name = "DecisionForest", engine = "ML Engine")
              ModelName  ModelAlgorithm ModelGeneratingEngine ModelGeneratingClient CreatedBy                 CreatedDate
0  decision_forest_model  DecisionForest             ML Engine            teradataml     ALICE  2020-05-17 23:59:48.740000

Example: List all models created by the user, with specific algorithm name, engine name and access level.

This example lists all models created by the user with algorithm name 'DecisionForest' and model generated using 'ML Engine', and access not set to PUBLIC.

>>> list_models(algorithm_name = "DecisionForest", engine = "ML Engine", accessible = False)
              ModelName  ModelAlgorithm ModelGeneratingEngine ModelGeneratingClient CreatedBy                 CreatedDate
0  decision_forest_model  DecisionForest             ML Engine            teradataml     ALICE  2020-05-17 23:59:48.740000
The list_models() function outputs basic information about the models that are accessible to the user and match any filter criteria that may have been provided.

For details about a specific model, use the describe_model() function.