repeatfolds | R Documentation |
Create folds for repeated nested CV
repeatfolds(y, repeats = 5, n_outer_folds = 10)
y |
Outcome vector |
repeats |
Number of repeats |
n_outer_folds |
Number of outer CV folds |
List containing indices of outer CV folds
data("iris")
dat <- iris
y <- dat$Species
x <- dat[, 1:4]
## set up fixed fold indices
set.seed(123, "L'Ecuyer-CMRG")
folds <- repeatfolds(y, repeats = 3, n_outer_folds = 4)
res <- nestcv.glmnet(y, x, family = "multinomial", alphaSet = 1,
n_outer_folds = 4, cv.cores = 2) |>
repeatcv(3, repeat_folds = folds)
res
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.