predict.emmix {EMMIXmfa} | R Documentation |
Extend Clustering to New Observations
Description
Given a fitted model of class
'emmix'
(or of class
'mfa'
, 'mcfa'
, 'mtfa'
and
'mctfa'
), the predict
function
predict clusters for observations.
Usage
## S3 method for class 'emmix'
predict(object, Y, ...)
Arguments
object |
An object of class |
Y |
A data matrix with variable in the same
column locations as the data used in
fitting the model |
... |
Not used. |
Details
A vector integers of length equal to number of
observations (rows) in the data. The integers range from 1 to
g
where g
in the number of components
in the model.
The variables in Y
of the predict
function should be in the order as those used in
obtaining the fitted model object
.
Examples
set.seed(42)
test <- sample(1 : nrow(iris), 100)
model <- mfa(iris[test, -5], g=3, q=3, itmax=500, nkmeans=3, nrandom=5)
pred_clust <- predict(model, iris[-test, -5])
minmis(pred_clust, iris[-test, 5])
[Package EMMIXmfa version 2.0.14 Index]