generate.cv: Generating groups for cross-validation

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

The function generate.cv generates randomly m groups for m-fold cross-validation.

Usage

1

Arguments

n

The total number of observations in the data set.

m

The desired number of groups.

Details

Leave-one-out cross-validation is a special case of cross-validation, with m=n.

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).

Author(s)

Anne-Laure Boulesteix (http://www.ibe.med.uni-muenchen.de/organisation/mitarbeiter/020_professuren/boulesteix/index.html)

References

A. L. Boulesteix (2007). WilcoxCV: an R package for fast variable selection in cross-validation. Bioinformatics 23:1702-1704.

See Also

generate.split,wilcox.split,wilcox.selection.split

Examples

1
2
3
4
5
# load WilcoxCV library
library(WilcoxCV)

# Generate 10 groups for a data set of size 95.
my.cv<-generate.cv(n=95,m=10)

WilcoxCV documentation built on May 2, 2019, 4:16 a.m.