Teradata R Package Function Reference | 17.00 - 17.00 - td_delete_model - Teradata R Package

Teradata® R Package Function Reference

prodname
Teradata R Package
vrm_release
17.00
created_date
September 2020
category
Programming Reference
featnum
B700-4007-090K

Description

Function to delete a saved model, and optionally the model objects.
A model can be deleted only by its creator.

Usage

td_delete_model(name, delete.objects = FALSE)

Arguments

name

Required Argument.
Specifies the name of the model to be deleted.
Types: character

delete.objects

Required Argument.
Specifies whether to drop objects of the model to be deleted.
When TRUE, the model objects are deleted/dropped.
Default Value: FALSE
Types: logical

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 - Only delete model information from the Model Catalog.
td_delete_model('glm_model')

# Example 2 - Delete model information from the Model Catalog 
# and drop model objects as well.
# This example does not apply to the model we just saved, as we have already
# deleted it from the catalog in Example 1.
# We save the model again with another name for this example.
td_save_model(model = td_glm_out1, name = "glm_model_2", description = "GLM test 2")

td_delete_model('glm_model_2', TRUE)