Creates a native mlr3::Resampling object from BORG
cross-validation folds, enabling direct use with mlr3 benchmarking
infrastructure.
Value
An mlr3::Resampling R6 object that can be used
directly with mlr3::resample(), mlr3::benchmark(),
and other mlr3 infrastructure.
Details
The returned resampling is pre-instantiated — it contains fixed
train/test splits that respect BORG's spatial/temporal blocking.
Calling $instantiate() is not needed (and will not
overwrite the existing splits).
Examples
# \donttest{
if (requireNamespace("mlr3", quietly = TRUE)) {
d <- data.frame(x = runif(100), y = runif(100), z = rnorm(100))
cv <- borg_cv(d, coords = c("x", "y"), target = "z")
resampling <- borg_to_mlr3(cv_obj = cv)
resampling$iters # number of folds
}
# }