Skip to contents

Assigns the population to k folds. If strata is provided, a stratified approach is adopted so that the percentage of each stratum in the population is preserved in each fold.

Usage

create_folds(N, k, strata = NULL)

Arguments

N

population size

k

number of folds

strata

(optional) vector of stratification variables. If provided must be of length N

Value

vector of length N containing the fold ids

Author

Alessandro Barberis