Classification Method using labeled data only

Share:

Description

noupclassifymodel implements the EM algorithm to classify unlabeled data using parameter estimates derived from labeled data only. It is a background function not designed to be used directly.

Usage

1
noupclassifymodel(Xtrain, cltrain, Xtest, cltest = NULL, modelName = "EEE", ...)

Arguments

Xtrain

A numeric matrix of observations 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 for the corresponding observations in Xtrain.

Xtest

A numeric matrix of observations 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 Xtest. By default, these are not supplied and the function sets out to determine these.

modelName

A character string indicating the model, with default "EEE". The models available for univariate and multivariate data are described in modelvec.

...

Arguments passed to or from other methods.

Value

The return value is a list with the following components:

call

The function call from noupclassifymodel or upclassifymodel

Ntrain

The number of observations in the training data.

Ntest

The number of observations in the test data.

d

The dimension of the data.

G

The number of groups in the data.

modelName

A character string identifying the model (same as the input argument)

parameters
pro

A vector whose kth component is the mixing proportion for the kth component of the mixture model

mean

The mean for each component. If there is more than one component, this is a matrix whose kthbcolumn is the mean of the kth component of the mixture model.

variance

A list of variance parameters for the model. The components of this list depend on the model specification.

train/test
z

A matrix whose [i,k]th entry is the conditional probability of the ith observation belonging to the kth component of the mixture.

cl

A numeric vector with distinct entries representing a classification of the corresponding obervations in Xtrain/Xtest.

rate

The number of misclassified observations.

Brierscore

The Brier score measuring the accuracy of the probabilities (z)s obtained

tab

A table of actual and predicted group classifications.

ll

The log-likelihood for the data in the mixture model.

bic

The Bayesian Information Criterion for the data.

References

Bensmail, H. and Celeux, G. (1996). Regularized Gaussian discriminant analysis through eigenvalue decomposition. Journal of the American Statistical Association 91:1743-1748.

Fraley, C. and Raftery, A.E. (2002). Model-based clustering, discriminant analysis, and density estimation. Journal of the American Statistical Association 97:611-631.

Fraley, 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.

See Also

modelvec, noupclassify

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# This function is not designed to be used on its own, 
# but to be called by \code{noupclassify}
data(wine, package = "gclus")
X <- as.matrix(wine[, -1])
cl <- unclass(wine[, 1])
indtrain <- sort(sample(1:178, 120))
indtest <- setdiff(1:178, indtrain)

fitnoup <- noupclassifymodel(X[indtrain,], 
cl[indtrain], X[indtest,], cl[indtest])