mclustDAtrain {mclust} | R Documentation |
Training phase for MclustDA discriminant analysis.
mclustDAtrain(data, labels, G=NULL, modelNames=NULL, prior=NULL, control=emControl(), initialization=NULL, warn=FALSE, verbose=TRUE, ...)
data |
A numeric vector, matrix, or data frame of observations. Categorical variables are not allowed. If a matrix or data frame, rows correspond to observations and columns correspond to variables. |
labels |
A numeric or character vector assigning a class label to each observation. |
G |
An integer vector specifying the numbers of mixture components
(clusters) for which the BIC is to be calculated.
The default is G=1:9 .
|
modelNames |
A vector of character strings indicating the models to be fitted
in the EM phase of clustering. The help file for
mclustModelNames describes the available models.
The default is c("E", "V") for univariate data and
mclustOptions()\$emModelNames for multivariate data.
|
prior |
The default assumes no prior, but this argument allows specification of a
conjugate prior on the means and variances through the function
priorControl .
|
control |
A list of control parameters for EM. The defaults are set by the call
emControl() .
|
initialization |
A list containing zero or more of the following components:
|
warn |
A logical value indicating whether or not certain warnings (usually related to singularity) should be issued when estimation fails. The default is to suppress these warnings. |
verbose |
A logical value indicating whether or not to print the models and
numbers of components for each class.
Default: verbose=TRUE .
|
... |
Catches unused arguments in indirect or list calls via do.call .
|
Except for labels
and verbose
, the arguments are the
same as those for mclustBIC
.
A list in which each element gives the parameters and other summary
information for the model best fitting each class according to BIC.
Attributes are the input parameters other than data
, labels
and verbose
.
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.
summary.mclustDAtrain
,
mclustDAtest
,
mclustBIC
odd <- seq(1, nrow(cross), by = 2) train <- mclustDAtrain(cross[odd,-1], labels = cross[odd,1]) ## training step summary(train) even <- odd + 1 test <- mclustDAtest(cross[even,-1], train) ## compute model densities clEven <- summary(test)$class ## classify training set classError(clEven,cross[even,1])