repeats (default: 30) times repeated splits into training and test set with a ratio of ratio (default: 2/3) observations in the training set.

ResamplingSubsampling

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 rss = mlr_resamplings$get("subsampling", param_vals = list(repeats = 2, ratio = 0.5)) rss$instantiate(task) # Individual sets: rss$train_set(1)
#> [1] 8 4 10 5 7
rss$test_set(1)
#> [1] 1 2 3 6 9
intersect(rss$train_set(1), rss$test_set(1))
#> integer(0)
# Internal storage: rss$instance$train # list of index vectors
#> [[1]] #> [1] 8 4 10 5 7 #> #> [[2]] #> [1] 10 4 8 3 1 #>