unmap {mclust} | R Documentation |
Converts a classification into a matrix of indicator variables.
unmap(classification, noise, ...)
classification |
A numeric or character vector. Typically the distinct entries of this vector would represent a classification of observations in a data set. |
noise |
A single numeric or character value used to indicate observations corresponding to noise. |
... |
Provided to allow lists with elements other than the arguments can
be passed in indirect or list calls with do.call .
|
An n by m matrix of (0,1) indicator variables,
where n is the length of classification
and m is
the number of unique values or symbols in
classification
. Columns are labeled by the unique values in
classification
, and the [i,j]
th entry is 1 if
classification[i]
is the jth unique value or symbol in
order of appearance in the classification
. If a noise
value of symbol is designated, the corresponding indicator variables
are located in the last column of the matrix.
C. Fraley and A. E. Raftery (2002a). Model-based clustering, discriminant analysis, and density estimation. Journal of the American Statistical Association 97:611-631. See http://www.stat.washington.edu/mclust.
C. Fraley and A. E. Raftery (2002b). MCLUST:Software for model-based clustering, density estimation and discriminant analysis. Technical Report, Department of Statistics, University of Washington. See http://www.stat.washington.edu/mclust.
data(iris) irisMatrix <- as.matrix(iris[,1:4]) irisClass <- iris[,5] z <- unmap(irisClass) z emEst <- me(modelName = "VVV", data = irisMatrix, z = z) emEst$z map(emEst$z)