repeats (default: 10) times repeated folds-fold (default: 10) cross-validation.

The iteration counter translates to repeats blocks of folds cross-validations, i.e., the first folds iterations belong to a single cross-validation.

ResamplingRepeatedCV

Format

R6::R6Class() inheriting from Resampling.

Fields

See Resampling.

Methods

See Resampling. Additionally, the class provides two helper function to translate iteration numbers to folds / repeats:

Examples

# Create a task with 10 observations task = mlr_tasks$get("iris") task$filter(1:10) # Instantiate Resampling rrcv = mlr_resamplings$get("repeated_cv") rrcv$param_set$values = list(repeats = 2, folds = 3) rrcv$instantiate(task) rrcv$iters
#> [1] 6
rrcv$folds(1:6)
#> [1] 1 2 1 2 1 2
rrcv$repeats(1:6)
#> [1] 1 1 1 2 2 2
# Individual sets: rrcv$train_set(1)
#> [1] 5 6 10 1 4 8
rrcv$test_set(1)
#> [1] 2 3 7 9
intersect(rrcv$train_set(1), rrcv$test_set(1))
#> integer(0)
# Internal storage: rrcv$instance # table
#> row_id rep fold #> 1: 1 1 3 #> 2: 2 1 1 #> 3: 3 1 1 #> 4: 4 1 3 #> 5: 5 1 2 #> 6: 6 1 2 #> 7: 7 1 1 #> 8: 8 1 3 #> 9: 9 1 1 #> 10: 10 1 2 #> 11: 1 2 2 #> 12: 2 2 3 #> 13: 3 2 1 #> 14: 4 2 1 #> 15: 5 2 2 #> 16: 6 2 1 #> 17: 7 2 1 #> 18: 8 2 3 #> 19: 9 2 3 #> 20: 10 2 2