Obtaining the Best Model for Data Classification Using Labeled Data only
Description
This function performs supervised classification over a range of different models and finds the model that best fits the data. In selecting the best model, the BIC values are compared.
Usage
1  noupclassify(Xtrain, cltrain, Xtest, cltest = NULL, modelscope = NULL, ...)

Arguments
Xtrain 
A numeric matrix of data where rows correspond to observations and columns correspond to variables. The group membership of each observation is known  labeled data. 
cltrain 
A numeric vector with distinct entries representing a classification of the corresponding observations in 
Xtest 
A numeric matrix of data where rows correspond to observations and columns correspond to variables. The group membership of each observation may not be known  unlabeled data. 
cltest 
A numeric vector with distinct entries representing a classification of the corresponding observations in 
modelscope 
A character string indicating the desired models to be tested. With default 
... 
Arguments passed to or from other methods 
Value
An object of class "upclassfit" providing a list of output components for each model in modelscope
, with the Best model (according to BIC) first.
The details of the output components are as follows
call 
How to call the function and the order of its arguments. 
Ntrain 
The number of observations in the training set. 
Ntest 
The number of observations in the test set. 
d 
The dimension of the data. 
G 
The number of groups in the training set. 
modelName 
The model considered in this run of the algorithm. 
parameters 
A list of the model parameters estimated by Mclust.

train 
A list of information about the training data. This will not have changed from before the run.

test 
A list of information about the test data.

ll 
The loglikelihood of the data. 
bic 
The Bayes information criterion for the specified model. 
Author(s)
Niamh Russell
References
Bensmail, H. and Celeux, G. (1996). Regularized gaussian discriminant analysis through eigenvalue decomposition. Journal of the American Statistical Association 91, 17431748.
C. Fraley and A.E. Raftery (2002). Modelbased clustering, discriminant analysis, and density estimation. Journal of the American Statistical Association 97, 611631.
C. Fraley and A.E. Raftery (2006) MCLUST Version 3 for R: Normal Mixture Modeling and ModelBased Clustering, Technical Report no. 504, Department of Statistics, University of Washington
See Also
upclassify
, noupclassifymodel
, modelvec
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  data(iris)
X< as.matrix(iris[,5])
cl<as.matrix(iris[,5])
indtrain < sort(sample(1:150, 30))
Xtrain < X[indtrain,]
cltrain < cl[indtrain]
indtest < setdiff(1:150, indtrain)
Xtest < X[indtest,]
cltest < cl[indtest]
fitnoupmodels < noupclassify(Xtrain, cltrain,
Xtest, cltest) #testing every model.
fitnoupmodels$Best$modelName

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.