repeats times repeated splits into training and test set with a ratio ratio of training observations.

ResamplingSubsampling

Format

R6::R6Class inheriting from Resampling.

Examples

# Create a task with 10 observations task = mlr_tasks$get("iris") task$filter(1:10) # Instantiate Resampling rss = mlr_resamplings$get("subsampling", param_vals = list(repeats = 2, ratio = 0.5)) rss$instantiate(task) # Individual sets: rss$train_set(1)
#> [1] 2 3 6 7 8
rss$test_set(1)
#> [1] 1 4 5 9 10
intersect(rss$train_set(1), rss$test_set(1))
#> integer(0)
# Internal storage: rss$instance$train # list of bit vectors
#> [[1]] #> bit length=10 occupying only 1 integers #> 1 2 3 4 5 6 7 8 9 10 #> FALSE TRUE TRUE FALSE FALSE TRUE TRUE TRUE FALSE FALSE #> #> [[2]] #> bit length=10 occupying only 1 integers #> 1 2 3 4 5 6 7 8 9 10 #> FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE #>