generates a ranking of models generated with modeltime_wfs_fit() function.

modeltime_wfs_rank(.wfs_results, rank_metric = NULL, minimize = TRUE)

Arguments

.wfs_results

a tibble generated with the modeltime_wfs_fit() function.

rank_metric

the metric used to generate the ranking 'mae', 'mape','mase','smape','rmse','rsq'.

minimize

a boolean indicating whether to minimize (TRUE) or maximize (FALSE) the metric

Value

a tibble containing the models ranked by a specific metric.

Details

the ranking depends on the metric selected.

See also

Examples

library(dplyr) library(modeltime) 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_rank(.wfs_results = wffits, rank_metric = 'rsq', minimize = FALSE)
#> # A tibble: 1 x 11 #> .model_id rank .model_desc .type mae mape mase smape rmse rsq #> <chr> <int> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 R_date_M_mars 1 EARTH Test 7577. 6.79 0.542 6.33 12524. 0.553 #> # … with 1 more variable: .fit_model <list>