R/modeltime_wfs_multirefit.R
modeltime_wfs_multirefit.Rd
It allows retraining a set of workflows trained on new data.
modeltime_wfs_multirefit(models_table)
models_table | a tibble that comes from the output of the |
---|
a tibble, corresponds to the same tibble supplied in the 'models_table' parameter but with the refit of the workflows saved in the 'nested_model' column.
library(dplyr) library(earth) df <- sknifedatar::emae_series datex <- '2020-02-01' df_emae <- df %>% dplyr::filter(date <= datex) %>% tidyr::nest(nested_column=-sector) %>% head(2) receta_base <- recipes::recipe(value ~ ., data = df %>% select(-sector)) mars <- parsnip::mars(mode = 'regression') %>% parsnip::set_engine('earth') wfsets <- workflowsets::workflow_set( preproc = list( R_date = receta_base), models = list(M_mars = mars), cross = TRUE) wfsets_fit <- modeltime_wfs_multifit(.wfs = wfsets, .prop = 0.8, serie = df_emae)#>#> ✓ Workflow training finished OK.#>#> ── 1 models fitted ♥ ───────────────────────────────────────────────────────────#>#> 0 models deleted x ──#>sknifedatar::modeltime_wfs_multirefit(wfsets_fit$table_time)#> # A tibble: 2 x 5 #> sector nested_column R_date_M_mars nested_model calibration #> <chr> <list> <list> <list> <list> #> 1 Comercio <tibble [194 × 2… <workflow> <model_time [1 × … <model_time [1 ×… #> 2 Ensenanza <tibble [194 × 2… <workflow> <model_time [1 × … <model_time [1 ×…