Teradata Package for R Function Reference | 17.00 - td_list_models - Teradata Package for R - Look here for syntax, methods and examples for the functions included in the Teradata Package for R.

Teradata® Package for R Function Reference

Product
Teradata Package for R
Release Number
17.00
Published
July 2021
Language
English (United States)
Last Update
2023-08-08
dita:id
B700-4007
NMT
no
Product Category
Teradata Vantage
td_list_models

Description

Function to list models accessible to the user and optionally only models created by the user.

Usage

td_list_models(
  name = NULL,
  algorithm.name = NULL,
  engine = NULL,
  accessible = TRUE,
  public = FALSE
)

Arguments

name

Optional Argument.
Specifies the search string for model name.
When this argument is used, all models matching the name are listed.
The search is case-insensitive.
Types: character

algorithm.name

Optional Argument.
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.
Types: character

engine

Optional Argument.
Specifies the model generating engine as a filter.
The search is case-insensitive.
Permitted Values: "ML Engine", "MLE", "Advanced SQL Engine", "SQLE"
Types: character

accessible

Optional Argument.
Specifies whether to list all models that the user has access to, or only the models that the user created.
When TRUE, all models which the user has access to are listed.
When FALSE, only models created by the user are listed.
Default Value: TRUE
Types: logical

public

Optional Argument.
Specifies whether to filter only those models that have public access.
Default Value: FALSE
Types: logical

Value

A data.frame representation of the model listing.

Examples


# Get remote data source connection.
con <- td_get_context()$connection

# Load example data.
loadExampleData("glm_example", "admissions_train")

# Create object of class "tbl_teradata" to use as input.
admissions_train <- tbl(con, "admissions_train")

# Create the GLM model.
td_glm_out1 <- td_glm_mle(formula = (admitted ~ stats + masters + gpa + programming),
                          family = "LOGISTIC",
                          linkfunction = "LOGIT",
                          data = admissions_train,
                          weights = "1",
                          threshold = 0.01,
                          maxit = 25,
                          step = FALSE,
                          intercept = TRUE
)

# Save this generated model.
td_save_model(model = td_glm_out1, name = "glm_model", description = "GLM test")

# Example 1 - List all models saved and accessible to the current user.
td_list_models()

# Example 2 - List models accessible to the user with
# name = 'glm_model'.
td_list_models(name = "glm_model")

# Example 3 - List all models accessible to the user with algorithm
# name 'GLM'.
td_list_models(algorithm.name = "GLM")

# Example 4 - List all models accessible to user with algorithm name
# 'GLM' and name containing string 'glm'.
td_list_models(name = "glm", algorithm.name = "GLM")

# Example 5 - List all models accessible to user with algorithm name
# 'GLM' and generated using 'ML Engine'.
td_list_models(algorithm.name = "GLM", engine = "ML Engine")

# Example 6 - List all models created by the user with algorithm name
# 'GLM', generated using 'MLE', and access not set to Public.
td_list_models(algorithm.name = "GLM", engine = "MLE",
               accessible = FALSE, public = FALSE)