cv: Function that creates customized cross-validation folds
Description
The function creates two matrices and returns them as members of a list. 'train' holds training sample indices, columns are cv-folds and rows are sample indices to hold as training samples in each fold. 'test' holds test/validation sample indices, columns are cv-folds and rows are sample indices to hold as test samples in each fold
Number of desired cross-validation folds; preferably between 3 (3-fold CV) and nrow(x) (LOO-CV)
strata
Indicator if some strata should be balanced over the bins; if no balancing is required, the vector should consist of a single value with length equal to rows in x. Otherwise each strata/batch should be indicated as a unique member in the vector.
shuffle
Whether the indices for the data matrix should be shuffled prior to assigning them to train/test bins