Description Usage Arguments Value Author(s) References See Also Examples
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.
1 | noupclassify(Xtrain, cltrain, Xtest, cltest = NULL, modelscope = NULL, ...)
|
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 |
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 log-likelihood of the data. |
bic |
The Bayes information criterion for the specified model. |
Niamh Russell
Bensmail, H. and Celeux, G. (1996). Regularized gaussian discriminant analysis through eigenvalue decomposition. Journal of the American Statistical Association 91, 1743-1748.
C. Fraley and A.E. Raftery (2002). Model-based clustering, discriminant analysis, and density estimation. Journal of the American Statistical Association 97, 611-631.
C. Fraley and A.E. Raftery (2006) MCLUST Version 3 for R: Normal Mixture Modeling and Model-Based Clustering, Technical Report no. 504, Department of Statistics, University of Washington
upclassify
, noupclassifymodel
, modelvec
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.