Simple holdout: A single split into training and test. Parameter ratio determines the ratio of observation in the train set.

ResamplingHoldout

Format

R6::R6Class inheriting from Resampling.

Examples

# Create a task with 10 observations task = mlr_tasks$get("iris") task$filter(1:10) # Instantiate Resampling rho = mlr_resamplings$get("holdout") rho$instantiate(task) # Individual sets: rho$train_set(1)
#> [1] 8 6 4 2 1 3 7
rho$test_set(1)
#> [1] 5 9 10
intersect(rho$train_set(1), rho$test_set(1))
#> integer(0)
# Internal storage: rho$instance # simple list
#> $train #> [1] 8 6 4 2 1 3 7 #> #> $test #> [1] 5 9 10 #>