Dario Federici
Dario Federici

Reputation: 1258

R clustering mclust extracting centroids

I'm using Mclust to cluster a dataset. After scoring each row I would like to get the centroids without passing through a loop and average the results by cluster. Is it possible to extract the centroids by attribute by querying the model?

Upvotes: 1

Views: 547

Answers (1)

shayaa
shayaa

Reputation: 2797

The mean parameter of the mclust model can be obtained by

mod1 = Mclust(iris[,1:4])
mod1$parameters[["mean"]]

Upvotes: 1

Related Questions