generate.learningsets: Generating learning sets

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

View source: R/generate.learningsets.r

Description

This function generates a design matrix giving the indices of observations forming the learning data set for several iterations.

Usage

1
generate.learningsets(n,method,fold=NULL,niter=NULL,nlearn=NULL)

Arguments

n

The total number of observations in the available data set.

method

One of "LOOCV" (leave-one-out cross-validation),"CV" (cross-validation),"MCCV" (Monte-Carlo cross-validation, also called subsampling),"bootstrap" (bootstrap sampling - with replacement).

fold

Gives the number of CV-groups. Used only when method="CV".

niter

Number of iterations.

nlearn

Number of observations in the learning sets. Used only for method="MCCV" and method="bootstrap". When method="bootstrap", the default is nlearn=n.

Details

When method="CV", niter gives the number of times the whole CV-procedure is repeated. The output matrix has then foldxniter rows. When method="MCCV" or method="bootstrap", niter is simply the number of considered learning sets. Note that method="CV",fold=n is equivalent to method="LOOCV".

Value

A matrix giving the indices (from 1 to n) of the observations included in the learning sets. Each row corresponds to a learning set. The order of the columns is not important. The number of rows is equal to n when method="LOOCV", niter when method="MCCV" or method="bootstrap", fold when method="CV" and niter is null, and fold x niter when method="CV" and niter is non-null.

Author(s)

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

References

Boulesteix AL, Porzelius C, Daumer M, 2008. Microarray-based classification and clinical predictors: On combined classifiers and additional predictive value. Bioinformatics 24:1698-1706.

See Also

testclass.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# load MAclinical library
# library(MAclinical)

# LOOCV
generate.learningsets(n=40,method="LOOCV")

# CV
generate.learningsets(n=40,method="CV",fold=5)
generate.learningsets(n=40,method="CV",fold=5,niter=3)

# MCCV
generate.learningsets(n=40,method="MCCV",niter=3,nlearn=30)

# bootstrap
generate.learningsets(n=40,method="bootstrap",niter=3)

MAclinical documentation built on May 2, 2019, 9:30 a.m.