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

Meaning of the position of winning nodes and distance map #165

Closed
EuCot opened this issue Mar 29, 2023 · 3 comments
Closed

Meaning of the position of winning nodes and distance map #165

EuCot opened this issue Mar 29, 2023 · 3 comments
Labels

Comments

@EuCot
Copy link

EuCot commented Mar 29, 2023

I've basically understood what som.distance_map() does: for each neuron of the SOM grid, it computes the average distance of that neuron from all its neighbors. Higher values mean more "isolated" neurons or group of neurons, whereas smaller values imply a denser region.

But I have seen that, if I do not specify a random_seed in the declaration of the SOM, every time I run the model the values of the (i,j) cell change (as expected) but the position of the input data in the grid (mapped with the som.winner() method) does not change accordingly.

I can make a practical example (let's say we have 2 cities - the rows of my dataset - called A and B)
First run of the model

  • I run the SOM and get a distance_map
  • Cell (2,3) has a big average distance value. A is mapped to (2,3)
  • Cell (2,4) has a smaller average distance value. B is mapped to (2,4)

Second run of the model

  • I run the SOM and get a distance_map
  • Cell (2,3) has now a small average distance value. A is mapped to (2,3)
  • Cell (2,4) has a small value too. B is mapped to (2,4)

In the first case, A and B should be distant in the input space, because both cells have high distance values, right? Then why doesn't the same happen in the second case, where they are seen much closer? Shouldn't they have been again mapped in darker zones?

@EuCot EuCot changed the title Changing values of distance_map() method Different outputs of distance_map() method Mar 29, 2023
@JustGlowing
Copy link
Owner

hi @EuCot

The fact that A and B are mapped in areas with different response of the distance map might suggest that they're far in the input space but it's not always the case. The winning positions in the map tell you more on how close they are they are adjacent in your example.

@EuCot
Copy link
Author

EuCot commented Mar 30, 2023

Thank you. So you are suggesting to rely mainly on the position on the map of the input data rather than on the relation between their position and the "weight" of each cell of the distance map?

But again, I know SOM is somehow a stochastic process (unless you use PCA initialization, in that case you always get the same result because it's deterministic), but what can the distance map tell us if it changes so deeply at each run of the model?

@JustGlowing
Copy link
Owner

JustGlowing commented Mar 30, 2023

Thank you. So you are suggesting to rely mainly on the position on the map of the input data rather than on the relation between their position and the "weight" of each cell of the distance map?

Usually the positions on the map and the weights are related (hence the distance map). However, it's not always the case.

But again, I know SOM is somehow a stochastic process (unless you use PCA initialization, in that case you always get the same result because it's deterministic), but what can the distance map tell us if it changes so deeply at each run of the model?

Just that the model is sensitive to the initial conditions. If you think that something is wrong though, check if the quantization and topological error are going down through the training.

@JustGlowing JustGlowing changed the title Different outputs of distance_map() method Meaning of the position of winning nodes and distance map Mar 31, 2023
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