create.folds {nestfs} | R Documentation |
Cross-validation folds
Description
Create a list of indices corresponding to cross-validation folds.
Usage
create.folds(num.folds, num.rows, seed = NULL)
Arguments
num.folds |
Number of folds to be created. |
num.rows |
Number of observations in the dataset. |
seed |
Seed of the random number generator. If |
Value
A list of length num.folds
containing the indices of the observations
to be withdrawn for validation in each fold.
Note
Note that the number of observations withdrawn in each fold may not be
exactly the same if num.folds
is not an integer divisor of num.rows
.
Examples
all.folds <- create.folds(50, 307, 0)
[Package nestfs version 1.0.3 Index]