Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/generate.learningsets.r
This function generates a design matrix giving the indices of observations forming the learning data set for several iterations.
1 | generate.learningsets(n,method,fold=NULL,niter=NULL,nlearn=NULL)
|
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 |
niter |
Number of iterations. |
nlearn |
Number of observations in the learning sets. Used only for |
When method="CV"
, niter
gives the number of times
the whole CV-procedure is repeated. The output matrix has then fold
xniter
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"
.
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.
Anne-Laure Boulesteix (http://www.ibe.med.uni-muenchen.de/organisation/mitarbeiter/020_professuren/boulesteix/eng.html)
Boulesteix AL, Porzelius C, Daumer M, 2008. Microarray-based classification and clinical predictors: On combined classifiers and additional predictive value. Bioinformatics 24:1698-1706.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.