mlr_resamplings_ncv {mlr3inferr} | R Documentation |
Nested Cross-Validation
Description
This implements the Nested CV resampling procedure by Bates et al. (2024).
Parameters
-
folds
::integer(1)
The number of folds. This is initialized to5
. -
repeats
::integer(1)
The number of repetitions. THis is initialized to10
.
Super class
mlr3::Resampling
-> ResamplingNestedCV
Active bindings
iters
(
integer(1)
)
The total number of resampling iterations.
Methods
Public methods
Inherited methods
Method new()
Creates a new instance of this R6 class.
Usage
ResamplingNestedCV$new()
Method unflatten()
Convert a resampling iteration to a more useful representation.
For outer resampling iterations, inner
is NA
.
Usage
ResamplingNestedCV$unflatten(iter)
Arguments
iter
(
integer(1)
)
The iteration.
Returns
list(rep, outer, inner)
Method clone()
The objects of this class are cloneable with this method.
Usage
ResamplingNestedCV$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
References
Bates, Stephen, Hastie, Trevor, Tibshirani, Robert (2024). “Cross-validation: what does it estimate and how well does it do it?” Journal of the American Statistical Association, 119(546), 1434–1445.
Examples
ncv = rsmp("nested_cv", folds = 3, repeats = 10L)
ncv
rr = resample(tsk("mtcars"), lrn("regr.featureless"), ncv)