Splits data into a training set and a test set. Parameter ratio determines the ratio of observation going into the training set (default: 2/3).

## Dictionary

This Resampling can be instantiated via the dictionary mlr_resamplings or with the associated sugar function rsmp():

### Method clone()

The objects of this class are cloneable with this method.

ResamplingHoldout$clone(deep = FALSE) #### Arguments deep Whether to make a deep clone. ## Examples # Create a task with 10 observations task = tsk("penguins") task$filter(1:10)

# Instantiate Resampling
rho = rsmp("holdout", ratio = 0.5)
rho$instantiate(task) # Individual sets: rho$train_set(1)
#> [1] 2 5 6 8 9rho$test_set(1) #> [1] 1 3 4 7 10intersect(rho$train_set(1), rho$test_set(1)) #> integer(0) # Internal storage: rho$instance # simple list
#> $train #> [1] 2 5 6 8 9 #> #>$test
#> [1]  1  3  4  7 10
#>