Splits data into training and test sets using manually provided indices.

Format

R6::R6Class inheriting from Resampling.

Construction

ResamplingCustom$new()
mlr_resamplings$get("custom")
rsmp("custom")

Fields

See Resampling.

Methods

See Resampling.

See also

Dictionary of Resamplings: mlr_resamplings

as.data.table(mlr_resamplings) for a complete table of all (also dynamically created) Resampling implementations.

Examples

# Create a task with 10 observations task = tsk("iris") task$filter(1:10) # Instantiate Resampling rc = rsmp("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