5.4 Custom resampling

Sometimes it is necessary to perform resampling with custom splits, e.g. to reproduce a study. For this purpose, splits can be manually set for ResamplingCustom:

resampling = mlr_resamplings$get("custom")
resampling$instantiate(task,
  list(c(1:10, 51:60, 101:110)),
  list(c(11:20, 61:70, 111:120))
)
resampling$iters
## [1] 1
resampling$train_set(1)
##  [1]   1   2   3   4   5   6   7   8   9  10  51  52
## [13]  53  54  55  56  57  58  59  60 101 102 103 104
## [25] 105 106 107 108 109 110
resampling$test_set(1)
##  [1]  11  12  13  14  15  16  17  18  19  20  61  62
## [13]  63  64  65  66  67  68  69  70 111 112 113 114
## [25] 115 116 117 118 119 120