allows working with workflow sets and modeltime. Combination of recipes and models are trained and evaluation metrics are returned.
modeltime_wfs_fit(.wfsets, .split_prop, .serie)
.wfsets | workflow_set object, generated with the |
---|---|
.split_prop | time series split proportion. |
.serie | time series dataframe. |
tbl_df containing the model id (based on workflow_set), model description and metrics on the time series testing dataframe. Also, a .fit_model column is included, which contains each fitted model.
Given a workflow_set containing multiple time series recipes and models, adjusts all the possible combinations on a time series. It uses a split proportion in order to train on a time series partition and evaluate metrics on the testing partition.
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) sknifedatar::modeltime_wfs_fit(.wfsets = wfsets, .split_prop = 0.8, .serie = data)#>#>#>#>#> ── 1 models fitted ♥ ───────────────────────────────────────────────────────────#>#> 0 models deleted x ──#>#> # A tibble: 1 x 10 #> .model_id .model_desc .type mae mape mase smape rmse rsq .fit_model #> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <list> #> 1 R_date_M_… EARTH Test 7577. 6.79 0.542 6.33 12524. 0.553 <model_time…