0

I have clustered my data with an SOM and kmeans

install.packages("kohonen")
library(kohonen)
set.seed(7)

som_grid <- somgrid(xdim = 8, ydim=8, topo="hexagonal")

som_model <- som(umfrage_veraendert_kurz, 
             grid=som_grid, 
             rlen=500, 
             alpha=c(0.05,0.01), 
             keep.data = TRUE )

I get from my som_model the "codes" and clustered it with kmeans

mydata <- som_model$codes

clusterzentren <- kmeans(mydata, center=3)
head(clusterzentren)

I have now 3 clusters but I don't know which data record goes to which cluster? How can I find it out?

Thanks for any help

Dr. Dot
  • 19
  • 4

1 Answers1

0

The return value of kmeans is a S3 object which contains not only the centers, but also the cluster assignment.

See the R manual of kmeans for details.

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
  • But I want to know in which cluster falls my data... I think I got it, it is possible to get more information about the function map from the kohonen package, in which data set goes into which neuron – Dr. Dot Jan 07 '17 at 17:28