predict: Extend Clustering to New Observations

Description Usage Arguments Details Examples

Description

Given a fitted model of class 'emmix' (or of class 'mfa', 'mcfa', 'mtfa' and 'mctfa'), the predict function predict clusters for observations.

Usage

1
2
## S3 method for class 'emmix'
predict(object, Y, ...)

Arguments

object

An object of class 'emmix'.

Y

A data matrix with variable in the same column locations as the data used in fitting the model object.

...

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

1
2
3
4
5
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])

EMMIXmfa documentation built on Dec. 18, 2019, 1:40 a.m.