upclassifymodel over a range of different models and finds the model that best fits the data by comparing the BIC values.
upclassify(Xtrain, cltrain, Xtest, cltest = NULL,
modelscope = NULL, tol = 10^-5, iterlim = 1000,
Aitken = TRUE, ...)Xtrain.
Xtest. By default, these are not supplied and the function sets out to obtain these.
modelvec.
tol to the change in log-likelihood between two consecutive iterations. For further information on Aitken acceleration, see Aitken.
modelscope, with the Best model (according to BIC) first.The details of the output components are as follows
converged is FALSE, then iter will be the maximum no of iterations.promeanvariancezclmisclassrateBriertabzclmisclassrateBriertabFraley, C. and Raftery, A.E. (2006). MCLUST Version for R: Normal Mixture Modeling and Model-Based Clustering, Technical Report no. 504, Department of Statistics, University of Washington.
Dean, N., Murphy, T.B. and Downey, G (2006). Using unlabelled data to update classification rules with applications in food authenticity studies. Journal of the Royal Statistical Society: Series C 55 (1), 1-14.
upclassifymodel, modelvec, Aitken
data(iris)
X <- as.matrix(iris[,-5])
cl <- unclass(iris[,5])
indtrain <- sort(sample(1:150,110))
Xtrain <- X[indtrain,]
cltrain <- cl[indtrain]
indtest <- setdiff(1:150, indtrain)
Xtest <- X[indtest,]
cltest <- cl[indtest]
modelscope <- c("EII", "VII", "VEI","EVI")
fitupmodels <- upclassify(Xtrain, cltrain, Xtest, cltest, modelscope)
fitupmodels$Best$modelName # What is the best model?
Run the code above in your browser using DataLab