.folds: Cross-validation folds
Description
Assigns samples to cross-validation folds,
balancing the folds in the case of a binary or survival response.
Usage
.folds(y, nfolds, foldid = NULL)
Value
Returns the fold identifiers.
Arguments
- y
response:
vector of length \(n\)
- nfolds
number of folds:
positive integer
(\(>= 10\) recommended)
- foldid
fold identifiers:
vector of length \(n\),
with entries from \(1\) to nfolds