Description Usage Arguments Details Value See Also Examples
View source: R/modeltime_multifit.R
allows multiple models to be fitted over multiple time series, using models from the 'modeltime' package.
1 | modeltime_multifit(serie, .prop, ...)
|
serie |
nested time series. |
.prop |
series train/test partition ratio. |
... |
models or workflows to train (model_1, model2, ...). |
the focus of this function is not related to panel series, it is oriented to multiple individual
series. Receiving as the first argument "series" a set of nested series (for example through the
nest()
function), then specifying a desired train/test partition ratio for series. The
final input to the function are the models to be trained, simply by typing the name
of the models separated by commas. The function admits as many models as required.
A list of 2 items. The first component is a tibble with a first column that contains the name of the series, and a second column called "nested_column" that stores the time series, then a column for each model where the trained models or workflows for each series are stored. The last 2 columns, "nested_model" and "calibration", store the "n" trained models for each series and the adjustment metrics on the test partition. The second element is a tibble saved with the name of 'models_accuracy', it allows to visualize the performance of each model for each series according to a set of metrics.
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(modeltime)
library(earth)
nested_serie <-
tidyr::nest(dplyr::filter(sknifedatar::emae_series, date < '2007-02-01'),
nested_column = -sector)
## Models
mars <- parsnip::mars(mode = 'regression') %>% parsnip::set_engine('earth')
# modeltime_multifit
sknifedatar::modeltime_multifit(serie = head(nested_serie,2),
.prop = 0.9,
mars)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.