repeatfolds function

Create folds for repeated nested CV

Create folds for repeated nested CV

repeatfolds(y, repeats = 5, n_outer_folds = 10)

Arguments

  • y: Outcome vector
  • repeats: Number of repeats
  • n_outer_folds: Number of outer CV folds

Returns

List containing indices of outer CV folds

Examples

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
  • Maintainer: Myles Lewis
  • License: MIT + file LICENSE
  • Last published: 2025-03-10