Skip to content

Instantly share code, notes, and snippets.

@sevamoo
Created September 8, 2016 07:08
Show Gist options
  • Star 26 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save sevamoo/035c56e7428318dd3065013625f12a11 to your computer and use it in GitHub Desktop.
Save sevamoo/035c56e7428318dd3065013625f12a11 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@XinyiYS
Copy link

XinyiYS commented Jun 22, 2017

Well explained, great read!

@d-ataman
Copy link

d-ataman commented Aug 9, 2017

Thanks a lot for the instructions, they are very helpful!

Can we similarly use 3-D data with the same SOM.build function?

@krisjanus
Copy link

how do you write the cluster labels back to the original dataset?

@shuangYUgit
Copy link

Thank you very much~!

@ukuleleplayer
Copy link

Thank you!
I've somewhat understood the examples above, but how do you go about using a dataset with 54 dimension which should cluster in 7 clusters?

@Rahib4
Copy link

Rahib4 commented Jul 12, 2018

I have the same question, how do we map clusters back to the original data? Given that we have extracted clusters for 400 neurons on the map but in reality, we have 800 points in the dataset. How do we use sompy to map it back to the dataset

@michaelscheinfeild
Copy link

how to get the accuracy of classification train test from umat

@AbdalaDiasse
Copy link

How to find the cluster label of the original data

@Mind-The-Data
Copy link

Mind-The-Data commented Dec 3, 2018

How would you implement kmeans outside of the sompy.py module? How do you access the codebook weight vectors of the grid?

@AbdalaDiasse @Rahib4 @ukuleleplayer @krisjanus

#To map grid cluster labels back to original data
map_labels = som.cluster(n_clusters=9)
data_labels = np.array([map_labels[int(k)] for k in som._bmu[0]]) # mapping labels from grid to original data

@AndreyBezhentsev
Copy link

What happens if I have 3 or more columns in entry matrix?

@KaderBerrouachedi
Copy link

SOMPY in spark ?

@mrexox
Copy link

mrexox commented Apr 4, 2019

Is it possible to extract data rows that match desired clusters after clusterization? I needs not umatrix but the entire data, what can you advise?

@hainguyenct
Copy link

Is it possible to extract coordinates of all features in the map? Let say, we have 100 features to generate a SOM map with 10x10 clusters, how to know the coordinates of features shown in the map? thank you so much.

@robot007
Copy link

Awesome work!! Thank you so much.

@heartofrevel
Copy link

Hi,
Is there any way so that i can have same cluster number on same dataset every time i run, like a seed parameter?

@CUGLiving
Copy link

extract data rows that match desired clusters after clusterization

Is it possible to extract coordinates of all features in the map? Let say, we have 100 features to generate a SOM map with 10x10 clusters, how to know the coordinates of features shown in the map? thank you so much.

Absolutely, you can enter into the source program and acquire the data what you want though add a few lines of code at the end of som.train() function, Actually, all of the graphics must be drawn by computed data,you can let that data return to you in source code. hope to help

@sfaz
Copy link

sfaz commented Feb 20, 2020

I am trying to install sompy but getting the error 'cannot import name 'SOM' from 'sompy' (/anaconda3/lib/python3.7/site-packages/sompy/init.py'

Please help

@rebelgiri
Copy link

Is there any prediction example?
By passing input determining the cluster..?

@lidiasm
Copy link

lidiasm commented Jul 12, 2020

I am trying to install sompy but getting the error 'cannot import name 'SOM' from 'sompy' (/anaconda3/lib/python3.7/site-packages/sompy/init.py'

Please help

Any solution? I'm facing the same issue.

@rebelgiri
Copy link

rebelgiri commented Jul 12, 2020

Did you install sompy?

Create new environment in python and download the code from repo.
go to your python environment and traverse to downloaded code and run the script
python setup.py install

@lidiasm
Copy link

lidiasm commented Jul 12, 2020

I tried that and it didn't work. I finally installed it following the next steps:

  1. pip install SOMPY-master.zip
  2. pip install ipdb

Is there any documentation somewhere? It's difficult to use some methods without documentation or examples.

@rebelgiri
Copy link

rebelgiri commented Jul 13, 2020

Example:
https://gist.github.com/sevamoo/035c56e7428318dd3065013625f12a11

I think we have only this example..
We need to read the code..
There some more SOM libraries, in case you need them
minisom : https://github.com/JustGlowing/minisom/blob/master/examples/Iris.ipynb (well documented, author available on twitter)
neupy : Self-Organizing Feature Maps (SOFM or SOM)
somoclu and SimpSOM

@anisioti
Copy link

Hello,
I would like to create a map not only with the trained instances, but also with unseen data that are going to be used by the function project_by(I assume). Is there a way to do something like this? Thanks

@akol67
Copy link

akol67 commented Jul 4, 2021

Indeed, good question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment