Description Usage Arguments Details Value Author(s) References See Also Examples
optimize the number of principal component to be used in LDA based on a cross-validation procedure.
1 2 3 4 5 |
data |
a data matrix, with samples saved in rows and features in columns. |
label |
a vector of response variables (i.e., group/concentration info), must be the same length as the number of samples. |
batch |
a vector of batch variables (i.e., batch/patient ID), must be given in case of |
nPC |
a vector of integers, the candidate numbers of principal components to be used for LDA, out of which an optimal value will be selected. |
optMerit |
a character value, the name of the merit to be optimized. The mean sensitivity will be optimized if |
maximize |
a boolean value, if or not maximize the merit. |
cv |
a character value, specifying the type of cross-validation. |
nPart |
an integer, the number of folds to be split for cross-validation. Equivelant to |
... |
parameters for |
build a classifier using each value in nPC
, of which the performance is evaluated with a normal k-fold or batch-wise cross-validation. The optimal number is selected as the one giving the maximal (maximize=TRUE
) or minimal (maximize=FALSE
) merit.
A two-layer cross-validation can be performed by using tunePcaLda
as the method
in crossValidation
.
A list of elements:
PCA |
PCA model |
LDA |
LDA model built with the optimal number of principal components |
nPC |
the optimal number of principal components |
Shuxia Guo, Thomas Bocklitz, Juergen Popp
S. Guo, T. Bocklitz, et al., Common mistakes in cross-validating classification models. Analytical methods 2017, 9 (30): 4410-4417.
crossValidation
, tunePcaLda
, lda
, prcomp
1 2 3 4 5 6 7 8 9 10 11 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.