View source: R/util-save_load.R
| load_model | R Documentation |
Load a BKT model from a file. This function loads a previously saved BKT model from an RDS file. The model attributes are restored into the provided model object, allowing it to be used for further analysis or predictions.
load_model(model, loc)
model |
A BKT model object into which the saved model's attributes will be loaded. |
loc |
Character. The file path from which the model will be loaded, typically an |
The updated BKT model object with the restored attributes from the saved model.
data("simulation_data_50", package = "BKT")
model <- bkt(seed = 42, parallel = FALSE, num_fits = 1)
fitted_model <- fit(model, data = simulation_data_50)
model_file <- tempfile(fileext = ".rds")
save_model(fitted_model, model_file)
loaded_model <- load_model(bkt(), model_file)
unlink(model_file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.