train_models | R Documentation |
This function implements the cross-validation method with the models mentioned above. The Ensemble model is a simple average of the CSR and Bagging model predictions. The Benchmark model comes from columns in data
, used to calculate the accuracy (RMSE) in relation to the observed y
. Usually, these columns are external predictions (Focus) used in the model and as a benchmark.
train_models( data, y, init_window = 150, horizon = 12, K = 20, k = 15, R = 500, pre_testing = "group-joint", quiet = FALSE, benchmark_col_regex = "expectativa_ipca_h_\\d{1,2}$", benchmark_name = "Focus", ... )
data |
A tsibble object |
y |
Column name of the variable of interest |
init_window |
Number of initial observations to be used in the first cross-validation subsample |
horizon |
Forecast horizon |
K |
Number of variables to be selected after the pre-testing. If K=ncol(x) the pre-testing is redundant (see |
k |
Number of variables in each subset. Must be smaller than K (see |
R |
Number of bootstrap replucations (see |
pre_testing |
The type of pre-testing (see |
quiet |
The default ( |
benchmark_col_regex |
Regex expression for internal selection of columns to take predictions from a "benchmark model". The number of columns must be at least 1 and at most equal to |
benchmark_name |
Name to be given to the benchmark model. |
... |
Arguments passed to the HDeconometrics package |
Tibble
df_macro <- get_data(quiet = TRUE) df_macro_augmented <- ts_transform(df_macro, "ipca") seasonal_dummies <- names(df_macro_augmented[, names(df_macro_augmented) %in% month.abb]) acc <- train_models(df_macro_augmented, "ipca", fixed.controls = seasonal_dummies)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.