crossval function

Generate sequence of indices for cross-validation

Generate sequence of indices for cross-validation

Generates and returns sequence of object indices for each segment in random segmented cross-validation

crossval(cv = 1, nobj = NULL, resp = NULL)

Arguments

  • cv: cross-validation settings, can be a number or a list. If cv is a number, it will be used as a number of segments for random cross-validation (if cv = 1, full cross-validation will be preformed), if it is a list, the following syntax can be used: cv = list('rand', nseg, nrep) for random repeated cross-validation with nseg segments and nrep repetitions or cv = list('ven', nseg) for systematic splits to nseg segments ('venetian blinds').
  • nobj: number of objects in a dataset
  • resp: vector with response values to use in case of venetian blinds

Returns

matrix with object indices for each segment

  • Maintainer: Sergey Kucheryavskiy
  • License: MIT + file LICENSE
  • Last published: 2024-08-19