deploy_models: Deploy models to SQL Server

Description Usage Arguments Examples

View source: R/interface.R

Description

Deploy models to SQL Server

Usage

1
deploy_models(model_config_path = "models.yml", db_config_path = "db.yml")

Arguments

model_config_path

A character vector representing the path to a YAML file with model configuration details

db_config_path

A character vector representing the path to a YAML file with database configuration details

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
a <- 1:10
b <- 2*1:10
c <- as.factor(a)
df <- data.frame(a, b, c)
formula = b ~ a + c
linear_model <- lm(formula, data = df)
saveRDS(linear_model, file="my_model.Rds")

# Now that the model is saved to disk, add the following
# record to models.yml, assuming that db_config

# mymodel:
#   name: "my_model"
#   path: "/path/to/my_model.Rds"
#   auxiliary_columns: ["INTERESTING_COLUMN"]
#   response_column: "b"
#   raw: "ORDER BY a, c ASC"
#   datasource: "[some_schema].[my_abcs]"

# In case we haven't yet prepared the model registry in our database
prepare_registry()
deploy_models()

team-sparkfish/castpack documentation built on Aug. 26, 2020, 7:34 a.m.