this function creates stratified folds in binary and multiclass classification

class_folds(folds, RESP, shuffle = FALSE)

Arguments

folds

is an integer specifying the number of folds

RESP

is the response variable

shuffle

is a boolean specifying if the vector of indices should be shuffled or not

Value

a list of indices

Examples

if (FALSE) { data(iris) y = as.factor(iris[, 5]) folds = class_folds(10, y, shuffle = TRUE) }