mlr_resamplings_forecast_cv | R Documentation |
Splits data using a folds
-folds (default: 10 folds) rolling window cross-validation.
This Resampling can be instantiated via the dictionary mlr_resamplings or with the associated sugar function rsmp()
:
mlr_resamplings$get("forecast_cv") rsmp("forecast_cv")
folds
(integer(1)
)
Number of folds.
window_size (integer(1)
)
(Minimal) Size of the rolling window.
horizon (integer(1)
)
Forecasting horizon in the test sets.
fixed_window (logial(1)
)
Flag for fixed sized window. If FALSE an expanding window is used.
mlr3::Resampling
-> ResamplingForecastCV
iters
(integer(1)
)
Returns the number of resampling iterations, depending on the values stored in the param_set
.
new()
Creates a new instance of this R6 class.
ResamplingForecastCV$new()
clone()
The objects of this class are cloneable with this method.
ResamplingForecastCV$clone(deep = FALSE)
deep
Whether to make a deep clone.
Bergmeir, Christoph, Hyndman, J R, Koo, Bonsoo (2018). “A note on the validity of cross-validation for evaluating autoregressive time series prediction.” Computational Statistics & Data Analysis, 120, 70–83.
as_benchmark_result()
to convert to a BenchmarkResult.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/performance.html#sec-resampling
Package mlr3viz for some generic visualizations.
Other resample:
mlr_resamplings_forecast_holdout
# Create a task with 10 observations
task = mlr3::tsk("airpassengers")
task$filter(1:20)
# Instantiate Resampling
rfho = mlr3::rsmp("forecast_cv", folds = 3, fixed_window = FALSE)
rfho$instantiate(task)
# Individual sets:
rfho$train_set(1)
rfho$test_set(1)
intersect(rfho$train_set(1), rfho$test_set(1))
# Internal storage:
rfho$instance # list
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.