4.2 Index vector for train/test splits

We opt to learn on 80% of all available observations and predict on the remaining 20% observations. For this purpose, we create two index vectors:

train_set = sample(task$nrow, 0.8 * task$nrow)
test_set = setdiff(seq_len(task$nrow), train_set)