View source: R/EvalTrainIndices.R
| EvalTrainIndices | R Documentation |
This function generates training and evaluation indices based on different cross-validation methods.
EvalTrainIndices(
eval.method,
sample.length,
sample.length_cor,
k = 1,
tail.out = TRUE
)
eval.method |
Character. The cross-validation method. Options include:
- |
sample.length |
Integer. Length of the sample (in years). |
sample.length_cor |
Integer. Length of forecast sample (in years) in
|
k |
Positive integer. Default = 1.
In method |
tail.out |
Logical for method |
A list of lists, where each element contains:
eval.dexes: Indices of evaluation points.
train.dexes: Indices of training points.
Theertha Kariyathan, theertha.kariyathan@bsc.es
# Leave-k-out cross-validation
EvalTrainIndices("leave-k-out", sample.length = 10, sample.length_cor = 5, k = 3)
# Retrospective cross-validation
EvalTrainIndices("retrospective", sample.length = 10, sample.length_cor = 5, k = 3)
# In-sample validation
EvalTrainIndices("in-sample", sample.length = 10, sample.length_cor = 5)
# Hindcast vs. Forecast validation
EvalTrainIndices("hindcast-vs-forecast", sample.length = 10, sample.length_cor = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.