0

I have used SOM tool box in MATLAB or iris data set. following example and using the plotsomhits i can see that how many data values are in each neuron of my neuron grid of the SOM . However I wish to know actual data values which are grouped in every neuron of the given SOM configuration .Is there any way to do it. this is the example I used.

net = selforgmap([8 8]);
view(net)
[net,tr] = train(net,x);
nntraintool
plotsomhits(net,x)
ironzionlion
  • 832
  • 1
  • 7
  • 28
Nhqazi
  • 732
  • 3
  • 12
  • 30

2 Answers2

0

not that hard. plotsomhits just plots "fancily" the results of the simulation of the net.

so if you simulate it and add the "hits" you have the result!

basicaly:

hits=sum(sim(net,x)');

In your net case this was my results, that coincide with the numbers in the plotsomehits

hits= 6     5     0     7    15     7     4     0     8    20     3     3     9     3     0     8     6     3    11     4     5     5     7    10     1

PD: you can learn a lot in this amazing SO answer:

MATLAB: help needed with Self-Organizing Map (SOM) clustering

Community
  • 1
  • 1
Ander Biguri
  • 35,140
  • 11
  • 74
  • 120
  • thanks Ander, However as I understand from your answer , please correct me if I am wrong in assuming that the statement sum(sim(net,x)') will give sum of all values clustered in a neuron. while i want to know what are values not their sum that are cluster to a single neuron – Nhqazi Jul 25 '14 at 16:20
  • @Nhqazi their values are 1... In a NN in general each output is binary, telling you if the result is from that output or not. So 7, means that 7 different inputs correspond to that specific output. I dont know much about SOM, this is just basic NN. – Ander Biguri Jul 25 '14 at 20:16
0

You need to convert vector to indices first and then you can see what input values a neuron correspond to.

>> input_neuron_mapping = vec2ind(net(x))';

Now, look into the neuron's inputs.

For example, you want to see neuron input values for neuron 2.

>> neuron_2_input_indices = find(input_neuron_mapping == 2)
>> neuron_2_input_values = x(neuron_2_input_indices)

It will display all the input values from your data.

Read here for more details: https://bioinformaticsreview.com/20220603/how-to-get-input-values-from-som-sample-hits-plot-in-matlab/