Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with clustering and visualization of neurons #182

Closed
zmajstorovic opened this issue Feb 20, 2024 · 1 comment
Closed

Help with clustering and visualization of neurons #182

zmajstorovic opened this issue Feb 20, 2024 · 1 comment
Labels

Comments

@zmajstorovic
Copy link

Hi, I'm reaching to you hoping that you can help me.

This is the snippet of my input data and som settings:
data= [[0.0, 0.85, 0.0, 0.0, 0.0, 0.85, 0.0, 0.85], [0.0, 0.85, 0.0, 0.9, 0.0, 0.85, 0.0, 0.9]...]
som = MiniSom(4, 4, 8, learning_rate= 0.5, neighborhood_function='gaussian', sigma=1.0)

I followed your tutorial on clustering, and instead of getting neuron-cluster representation I get neurons plotted in sets of four of the same color (total 16 neurons). I expected 16 different colors, each color for one set of the data assigned to certain neuron.
For image plotting I used the same code as in Clustering notebook

image_2024-02-20_143623737

som.winner(data[0]) gets me the result e.g. (3,1)

With som.get_weights() I have following values:
image

Question: How do I get neuron coordinates from this table? I don't understand how (3,1) translates to coordinate system same as the input data.

@JustGlowing
Copy link
Owner

hi,

I followed your tutorial on clustering, and instead of getting neuron-cluster representation I get neurons plotted in sets of four of the same color (total 16 neurons). I expected 16 different colors, each color for one set of the data assigned to certain neuron.

Even if you have 16 neurons, during clustering only a subset might end up mapping some samples.

Question: How do I get neuron coordinates from this table? I don't understand how (3,1) translates to coordinate system same as the input data.

  • You can use the method winner to get neuron coordinates.
  • (3, 1) is used to define the size of the map.

My advice is to use a map with a small number of neuron first (for example (3,1)) and see if the results look like in the example, if so you can start increasing the size until it makes sense for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants