td_list_models() |Teradata R Package - 17.00 - td_list_models() - Teradata R Package

Teradata® R Package User Guide

prodname
Teradata R Package
vrm_release
17.00
created_date
November 2020
category
User Guide
featnum
B700-4005-090K
The td_list_models() function provides the user with the ability to list all models that are accessible to the user, and optionally filter on certain criteria like:
  • The model name.
  • The name of the algorithm that was used to generate the model.
  • The model generating engine.
  • Flag to list models created by or accessible to the user.
  • Flag to list models with the access level is set to PUBLIC (see the td_publish_model() section).
A user can only see the models that he or she has access to.
Optional arguments:
  • name specifies the search string for model name. When this argument is used, all models matching the name are listed.

    The search is case-insensitive.

  • algorithm.name specifies the search string for the analytic function name. When this argument is used, all models matching it are listed.

    The search is case-insensitive.

  • engine specifies the model generating engine as a filter.

    Permitted values include: "ML Engine", "MLE", "Advanced SQL Engine", "SQLE".

    The search is case-insensitive.

  • accessible specifies whether to list all models that the user has access to, or only the models that the user created.
    • If True, all models to which the user has access are listed.
    • If False, all models created by the user are listed.
  • public specifies whether to filter only those models that have public access.

The function returns a data.frame representing the model listing.

Example Prerequisites

Follow the steps in td_save_model() to create and save a model.

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

> td_list_models()
  ModelName ModelAlgorithm ModelGeneratingEngine ModelGeneratingClient CreatedBy         CreatedDate
1 glm_model            GLM             ML Engine                tdplyr     ALICE 2020-07-12 22:14:34

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

You can pass a substring as well.

> td_list_models(name = "glm_model")
  ModelName ModelAlgorithm ModelGeneratingEngine ModelGeneratingClient CreatedBy         CreatedDate
1 glm_model            GLM             ML Engine                tdplyr     ALICE 2020-07-12 22:14:34

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

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

> td_list_models(algorithm.name = "GLM")
  ModelName ModelAlgorithm ModelGeneratingEngine ModelGeneratingClient CreatedBy         CreatedDate
1 glm_model            GLM             ML Engine                tdplyr     ALICE 2020-07-12 22:14:34

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

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

> td_list_models(name = "glm", algorithm.name = "GLM")
  ModelName ModelAlgorithm ModelGeneratingEngine ModelGeneratingClient CreatedBy         CreatedDate
1 glm_model            GLM             ML Engine                tdplyr     ALICE 2020-07-12 22:14:34

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

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

> td_list_models(algorithm.name = "GLM", engine = "ML Engine")
  ModelName ModelAlgorithm ModelGeneratingEngine ModelGeneratingClient CreatedBy         CreatedDate
1 glm_model            GLM             ML Engine                tdplyr     ALICE 2020-07-12 22:14:34

Example 6: 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 'GLM' and model generated using 'ML Engine', and access not set to PUBLIC.

> td_list_models(algorithm.name = "GLM", engine = "MLE", accessible = FALSE, public = FALSE)
  ModelName ModelAlgorithm ModelGeneratingEngine ModelGeneratingClient CreatedBy         CreatedDate
1 glm_model            GLM             ML Engine                tdplyr     ALICE 2020-07-12 22:14:34
The td_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 td_describe_model() function.