modeltime_multibestmodel: Gets the best model from a modeltime table

Description Usage Arguments Details Value Examples

View source: R/modeltime_multibestmodel.R

Description

this feature allows you to select the best model for each series, based on a specific evaluation metric.

Usage

1
2
3
4
5
6
modeltime_multibestmodel(
  .table,
  .metric = NULL,
  .minimize = TRUE,
  .forecast = TRUE
)

Arguments

.table

'table_time**' tibble generated with the modeltime_multifit() function.

.metric

evaluation metric, from modeltime_accuracy() of 'modeltime' package: 'mae', 'mape','mase','smape','rmse','rsq'.

.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 modeltime_multi forecast() function has already been applied to the object that enters the ".table" parameter. This is evaluated by the existence of the column "nested_forecast".

Details

take the object 'table_time' from the output of the function modeltime_multifit(), and selects the best model based on the selected metric.

Value

table_time tibble filtered by the best model.

Examples

1
2
3
4
5
6
7
8
# Data
data_serie <- sknifedatar::table_time
                                      
# best_model_emae
sknifedatar::modeltime_multibestmodel(.table = data_serie$table_time,
                                      .metric = "rmse",
                                      .minimize = TRUE,
                                      .forecast = FALSE)

sknifedatar documentation built on June 1, 2021, 9:08 a.m.