Description Usage Arguments Examples
View source: R/core-save_and_load.R
GluonTS models require a special storage process that saves / loads the recipe used to recreate a model to / from a directory that the user defines.
1 2 3 | save_gluonts_model(object, path, overwrite = FALSE)
load_gluonts_model(path)
|
object |
A fitted model object |
path |
A directory to store the GluonTS model files |
overwrite |
Whether or not to allow overwriting a GluonTS model's directory. Default: FALSE. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run:
library(tidymodels)
library(tidyverse)
library(timetk)
model_fit <- nbeats(
# User Defined (Required) Parameters
id = "id",
freq = "M",
prediction_length = 24,
# Hyper Parameters
epochs = 1,
num_batches_per_epoch = 4
) %>%
set_engine("gluonts_nbeats") %>%
fit(value ~ date + id, m750)
# Saves the related files needed to recreate the model
model_fit %>% save_gluonts_model(path = "/dir_nbeats_model/")
# Loads the model
load_gluonts_model(path = "/dir_nbeats_model/")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.