generate.cv: Generating groups for cross-validation
Description
The function generate.cv generates randomly m groups for m-fold cross-validation.
Usage
generate.cv(n,m)
Arguments
n
The total number of observations in the data set.
m
The desired number of groups.
Value
A m x ceiling(n/m) matrix giving the indices of the observations included in each
group. The i-th row gives the indices of observations included in the i-th group. If the m
groups are not perfectly equally sized, the last column includes one or several zero(s).
Details
Leave-one-out cross-validation is a special case of cross-validation, with m=n.
References
A. L. Boulesteix (2007). WilcoxCV: an R package for fast variable selection in cross-validation. Bioinformatics 23:1702-1704.