applies the modeltime_refit() function from 'modeltime' package to the object generated from the modeltime_wfs_fit() function (or the filtered version after the modeltime_wfs_bestmodel() is applied).

modeltime_wfs_refit(.wfs_results, .serie)

Arguments

.wfs_results

tibble of combination of recipes and models fitted, generated with the modeltime_wfs_fit() function.

.serie

a time series dataframe.

Value

a tibble containing the re-trained models.

Details

each workflow is now re-trained using all the available data.

Examples

library(modeltime) library(dplyr) library(earth) data <- sknifedatar::data_avellaneda %>% mutate(date=as.Date(date)) %>% filter(date<'2012-06-01') recipe_date <- recipes::recipe(value ~ ., data = data) %>% recipes::step_date(date, features = c('dow','doy','week','month','year')) mars <- parsnip::mars(mode = 'regression') %>% parsnip::set_engine('earth') wfsets <- workflowsets::workflow_set( preproc = list( R_date = recipe_date), models = list(M_mars = mars), cross = TRUE) wffits <- sknifedatar::modeltime_wfs_fit(.wfsets = wfsets, .split_prop = 0.8, .serie = data)
#> ── MODEL: R_date_M_mars
#> Training finished OK.
#>
#>
#> ── 1 models fitted ♥ ───────────────────────────────────────────────────────────
#>
#> ── 0 models deleted x ──
#>
sknifedatar::modeltime_wfs_refit(.wfs_results = wffits, .serie = data)
#> # Modeltime Table #> # A tibble: 1 x 3 #> .model_id .model .model_desc #> <chr> <list> <chr> #> 1 R_date_M_mars <workflow> EARTH