createFolds.RdUsed to create balanced folds with respect to y input for k-fold validation.
.createFolds(y, k = 10, list = TRUE, returnTrain = FALSE)
| y | split sample by balancing y |
|---|---|
| k | number of folds |
| list | logical whether to return folds in a list |
| returnTrain | logical whether to return training indices (T) or the test samples (F) |