View source: R/train_test_index.R
| train_test_index | R Documentation |
Generate train/test indexes to train and evaluate the models using rolling-origin-update evaluation (ROUE).
train_test_index(
X,
n = NULL,
date_start = NULL,
date_end = NULL,
horizon = 1,
frequency = c("month", "quarter")
)
X |
A df/tibble containing the predictors. |
n |
A numeric indicating the size of the initial window. Cannot be
used with |
date_start |
A character indicating the starting date of the initial window.
It must be of the form
|
date_end |
A character indicating the last date of the initial window.
It must be of the form
|
horizon |
A integer indicating the number of consecutive values in test set sample - if missing defaults to 1. |
frequency |
A character indicating the date frequency. Must be one of
|
Note: if X has non-consecutive dates, it is better to generate train/test
indexes using n rather than date_start and date_end to avoid unexpected
results.
A list with 2 items: one for training indexes, one for test indexes.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.