sevamoo / SOMPY

A Python Library for Self Organizing Map (SOM)
Apache License 2.0
532 stars 241 forks source link

Issues with hexagonal grid #95

Open drryanmarks opened 5 years ago

drryanmarks commented 5 years ago

Hi,

I have an issue with using the hexagonal grid. I've run the code for airline example but when I plot the hexagonal grids all of the 'hot spots' are arranged in horizontal lines on the hexagon plot, not clustered into specific regions of the grids. Has anyone else had this issue? Please see image attached. image

HariharanOJ commented 5 years ago

image

In sompy.codebook.py file change the y_coord formula the problem is python takes 2/3 as zero so replace it with 2.0/3

drryanmarks commented 5 years ago

Thanks!

I've changed the code but I am still getting the error. I notice that when I train the SOM the topographical error always = 0 which is making me think that there is something wrong there also. Any ideas?

I'm going to have a look into the code to see if there is a similar issue.

HariharanOJ commented 5 years ago

I got the same plots initially , I tried checking the codebook matrix and noticed that the all elements in the row had the same values . After making the above correction it worked fine. Sorry I wasn't able to help you.

drryanmarks commented 5 years ago

I'm an idiot! For some reason I have two set of sompy files on my PC in the python folder and, yep - you've guessed it, I edited the wrong folder. I realized my mistake when I was putting in 'print' statements and they were not working.

I've made the change in the correct codebook and now it seems to be working. Moral of the story is make sure that you are editing the code that you are calling - a whole day of debugging in vain!

Thanks for your help