Description Usage Arguments Value Author(s) See Also Examples
K-fold cross-validation for discriminant analysis based on Gaussian finite mixture modeling.
1 2 3 4 | cvMclustDA(object, nfold = 10,
metric = c("error", "brier"),
prop = object$prop,
verbose = interactive(), ...)
|
object |
An object of class |
nfold |
An integer specifying the number of folds. |
metric |
A character string specifying the statistic to be used in the
cross-validation resampling process. Possible values are |
prop |
A vector of class prior probabilities, which if not provided default to the class proportions in the training data. |
verbose |
A logical controlling if a text progress bar is displayed during the cross-validation procedure. By default is |
... |
Further arguments passed to or from other methods. |
The function returns a list with the following components:
classification |
a factor of cross-validated class labels. |
z |
a matrix containing the cross-validated probabilites for class assignement. |
error |
the cross-validation classification error if |
brier |
the cross-validation Brier score if |
se |
the standard error of the cross-validated statistic. |
Luca Scrucca
summary.MclustDA
,
plot.MclustDA
,
predict.MclustDA
,
classError
,
BrierScore
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
X <- iris[,-5]
Class <- iris[,5]
# common EEE covariance structure (which is essentially equivalent to linear discriminant analysis)
irisMclustDA <- MclustDA(X, Class, modelType = "EDDA", modelNames = "EEE")
cv <- cvMclustDA(irisMclustDA) # default 10-fold CV
cv[c("error", "se")]
cv <- cvMclustDA(irisMclustDA, nfold = length(Class)) # LOO-CV
cv[c("error", "se")]
cv <- cvMclustDA(irisMclustDA, metric = "brier") # 10-fold CV with Brier score metric
cv[c("brier", "se")]
# general covariance structure selected by BIC
irisMclustDA <- MclustDA(X, Class)
cv <- cvMclustDA(irisMclustDA) # default 10-fold CV
cv[c("error", "se")]
cv <- cvMclustDA(irisMclustDA, metric = "brier") # 10-fold CV with Brier score metric
cv[c("brier", "se")]
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.