# 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")]
# }
Run the code above in your browser using DataLab