MVA.cv | R Documentation |
Performs cross validation with different PLS and/or discriminant analyses.
MVA.cv(X, Y, repet = 10, k = 7, ncomp = 8, scale = TRUE, model = c("PLSR",
"CPPLS", "PLS-DA", "PPLS-DA", "LDA", "QDA", "PLS-DA/LDA", "PLS-DA/QDA",
"PPLS-DA/LDA", "PPLS-DA/QDA"), lower = 0.5, upper = 0.5, Y.add = NULL,
weights = rep(1, nrow(X)), set.prior = FALSE, crit.DA = c("plug-in",
"predictive", "debiased"), ...)
X |
a data frame of independent variables. |
Y |
the dependent variable(s): numeric vector, data frame of quantitative variables or factor. |
repet |
an integer giving the number of times the whole procedure has to be repeated. |
k |
an integer giving the number of folds (can be re-set internally if needed). |
ncomp |
an integer giving the number of components to be used for all models except LDA and QDA (can be re-set depending on the size of the train sets). |
scale |
logical indicating if data should be scaled (see Details). |
model |
the model to be fitted (see Details). |
lower |
a vector of lower limits for power optimisation in CPPLS or PPLS-DA (see |
upper |
a vector of upper limits for power optimisation in CPPLS or PPLS-DA (see |
Y.add |
a vector or matrix of additional responses containing relevant information about the observations, in CPPLS or PPLS-DA (see |
weights |
a vector of individual weights for the observations, in CPPLS or PPLS-DA (see |
set.prior |
only used when a LDA or QDA is performed (coupled or not with a PLS model). If |
crit.DA |
criterion used to predict class membership when a LDA or QDA is used. See |
... |
other arguments to pass to |
When a discriminant analysis is used ("PLS-DA"
, "PPLS-DA"
, "LDA"
, "QDA"
, "PLS-DA/LDA"
, "PLS-DA/QDA"
, "PPLS-DA/LDA"
or "PPLS-DA/QDA"
), the training sets are generated in respect to the relative proportions of the levels of Y
in the original data set (see splitf
).
"PLS-DA"
is considered as PLS2 on a dummy-coded response. For a PLS-DA based on the CPPLS algorithm, use "PPLS-DA"
with lower
and upper
limits of the power parameters set to 0.5
.
If scale = TRUE
, the scaling is done as this: for each step of the validation loop (i.e. k
steps), the training set is pre-processed by centering and unit-variance scaling. Means and standard deviations of variables in the training set are then used to scale the test set.
model |
model used. |
type |
type of model used. |
repet |
number of times the whole procedure was repeated. |
k |
number of folds. |
ncomp |
number of components used. |
crit.DA |
criterion used to classify individuals of the test sets. |
groups |
levels of |
models.list |
list of of models generated ( |
models1.list |
list of of (P)PLS-DA models generated ( |
models2.list |
list of of LDA/QDA models generated ( |
RMSEP |
RMSEP vales ( |
Q2 |
Q2 values ( |
NMC |
Classification error rates ( |
confusion |
Confusion matrices ( |
pred.prob |
Probability of each individual of being of each level of |
Maxime HERVE <maxime.herve@univ-rennes1.fr>
predict.MVA.cmv
, mvr
, lda
, qda
require(pls)
require(MASS)
# PLSR
data(yarn)
## Not run: MVA.cv(yarn$NIR,yarn$density,model="PLSR")
# PPLS-DA coupled to LDA
data(mayonnaise)
## Not run: MVA.cv(mayonnaise$NIR,factor(mayonnaise$oil.type),model="PPLS-DA/LDA")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.