A custom resampling class where the training and test indices can be set manually.

ResamplingCustom

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 rc = mlr_resamplings$get("custom") train_sets = list(1:5, 5:10) test_sets = list(5:10, 1:5) rc$instantiate(task, train_sets, test_sets) rc$train_set(1)
#> [1] 1 2 3 4 5
rc$test_set(1)
#> [1] 5 6 7 8 9 10