0

I'm quite new to SOM. I am using Kohonen package in R to build my SOM. In the counts plot, could find a very dense node at one of the corners of the map. This dense node at times shift to another corner at random, when I retrain the network. The map still means the same, as it is just being rotated by 90, 180 or 270 degrees. However the report I wish to generate would be better if it follows the same convention. So, how do I make the map fix to one position? Or is there a way to rotate the plot?

example 1 example 2

In spite of setting seed value and having the same no. of iterations in the training process, I cannot fix this dense node to one particular corner.

If it helps, here's my code:

require(kohonen)
set.seed(100)
som_grid = somgrid(xdim = 20, ydim = 20, topo = "hexagonal")
som_model = som(train,grid=som_grid,rlen=300,alpha=c(0.05,0.01),keep.data = TRUE, n.hood = "circular")
 plot(som_model, type = "count")

Any idea? Thanks in advance.

Convergence

el.diablo
  • 21
  • 7
  • What is the train variable? You're code isn't reproducible yet. Is train data from a randomised selection of rows chosen before set.seed(100) in the code? – FXQuantTrader Jul 06 '16 at 08:36
  • The dataset 'train', is not generated. It's real data acquired from sensors. I am setting seed in an attempt to stop the map from rotating. I have read that the initial codes of the nodes are chosen at random. Hence, I tried this. – el.diablo Jul 06 '16 at 09:35

1 Answers1

0

So, how do I make the map fix to one position? Different seed values will produce different plot layouts as you describe, but they mean the same thing, provided the SOM map has converged. I don't think you can physically tell the SOM map to pick a certain corner to cluster certain aspects of the data. The seed value will set the shape.

More importantly (slightly related to your question), are you sure the SOM has converged reasonably well? My response here describes convergence of SOMs

Or is there a way to rotate the plot? Not out of the box as far as I'm aware... you could try editing the source code though for the package.

Community
  • 1
  • 1
FXQuantTrader
  • 6,821
  • 3
  • 36
  • 67
  • The maps have converged. I have added an example changes-plot. All trials have a similar convergence pattern. Different seed values producing different plot layouts would be fine. But, the same seed value is giving me different plot layouts. That's my problem. I'll have a look at the package source code. Thanks for your time. – el.diablo Jul 06 '16 at 09:43
  • The same seed should give the same plot layouts, I think. Can you give some minimal reproducible data for the problem? Presume you've read this already? https://www.jstatsoft.org/article/view/v021i05/v21i05.pdf – FXQuantTrader Jul 06 '16 at 09:48
  • I don't have the an answer for this. But, I found out the reason behind this behavior of the SOM. My maps don't converge to absolute 0 changes. Beyond 250 iterations, the curve has reduced but, there is always a certain change. This is due to the nature of my dataset. But, sorry the data is highly confidential. I cannot share it online, as it's against my company's terms. – el.diablo Jul 06 '16 at 11:39