
lda
) and Partial Least Squares - Discriminant Analysis (by using plsda
) are handled. Two methods are implemented for cross-validation: leave-one-out and M-fold.DA.valid(model, method = c("loo", "Mfold"), crit.lda = c("plug-in", "predictive",
"debiased"), crit.plsda = c("mahalanobis.dist", "centroids.dist", "max.dist"),
M = 10, nrep = 20)
"Mfold"
or "loo"
(see below). Default is "Mfold"
."plug-in"
(the default) the usual unbiased parameter estimates are used and assumed to be correct. With "debiased"
an unbiased estimator of the"mahalanobis.dist"
(default), "centroids.dist"
or "max.dist"
.model
(they are not evaluated from the training dataset itself).lda
, predict.lda
, plsda
, valid
# Cross-validation of a LDA model
require(MASS)
data(iris)
model.LDA <- lda(iris[,1:4],iris$Species)
DA.valid(model.LDA,M=5,nrep=10)
# Cross-validation of a PLS-DA model
require(mixOmics)
data(yeast)
model.PLSDA <- plsda(t(yeast$data),yeast$strain.cond)
DA.valid(model.PLSDA,M=5,nrep=10)
Run the code above in your browser using DataLab