Skip to content
Prev 376885 / 398502 Next

cluster samples using self organizing map in R

Hi Tina,

What's wrong with what you did?

The output object of som() contains the classification of each sample.

You probably do need to read more about self-organizing maps, since
you specified you wanted the samples classified into nine groups, and
that's unlikely to be your actual intent.

I have no idea what you thought your hierarchical clustering step was
supposed to do, either.

Here's one way to get 3 groups instead of 9:

library(kohonen)
iris.sc <- scale(iris[, 1:4])
iris.som <- som(iris.sc, grid=somgrid(xdim = 1, ydim=3,
topo="rectangular"), rlen=100, alpha=c(0.05,0.01))

table(iris.som$unit.classif, iris$Species)
plot(iris.som)

Sarah
On Wed, Oct 10, 2018 at 2:14 AM A DNA RNA <email2mrna at gmail.com> wrote: