R/modeltime_multibestmodel.R
modeltime_multibestmodel.Rd
this feature allows you to select the best model for each series, based on a specific evaluation metric.
modeltime_multibestmodel( .table, .metric = NULL, .minimize = TRUE, .forecast = TRUE )
.table | 'table_time**' tibble generated with the |
---|---|
.metric | evaluation metric, from |
.minimize | boolean (default = TRUE), TRUE if the error metric should be minimized, FALSE in order to maximize it. |
.forecast | boolean (default = TRUE), If it is TRUE, it indicates that the |
table_time tibble filtered by the best model.
take the object 'table_time' from the output of the function modeltime_multifit()
,
and selects the best model based on the selected metric.
# Data data_serie <- sknifedatar::table_time # best_model_emae sknifedatar::modeltime_multibestmodel(.table = data_serie$table_time, .metric = "rmse", .minimize = TRUE, .forecast = FALSE)#> # A tibble: 2 x 7 #> sector nested_column m_ets m_nnetar nested_model calibration best_model #> <chr> <list> <lis> <list> <list> <list> <list> #> 1 Comerc… <tibble [49 × … <fit… <fit[+]> <model_time [… <model_time … <int [1]> #> 2 Ensena… <tibble [49 × … <fit… <fit[+]> <model_time [… <model_time … <int [1]>