Cross validation with folds folds (cv: 10 folds, cv3: 3 folds).

ResamplingCV

Format

R6::R6Class inheriting from Resampling.

Fields

See Resampling.

Methods

See Resampling.

Examples

# Create a task with 10 observations task = mlr_tasks$get("iris") task$filter(1:10) # Instantiate Resampling rcv = mlr_resamplings$get("cv") rcv$param_set$values = list(folds = 3) rcv$instantiate(task) # Individual sets: rcv$train_set(1)
#> [1] 6 8 10 2 3 7
rcv$test_set(1)
#> [1] 1 4 5 9
intersect(rcv$train_set(1), rcv$test_set(1))
#> integer(0)
# Internal storage: rcv$instance # table
#> row_id fold #> 1: 1 1 #> 2: 4 1 #> 3: 5 1 #> 4: 9 1 #> 5: 6 2 #> 6: 8 2 #> 7: 10 2 #> 8: 2 3 #> 9: 3 3 #> 10: 7 3