Description Usage Arguments Examples
Deploy models to SQL Server
1 | deploy_models(model_config_path = "models.yml", db_config_path = "db.yml")
|
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 |
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()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.