MATLAB Answers

0

How to label unlabeled data(e.g. 200*2 matrix) in Self Organizing Map?

Asked by Hossain Ahmed Zobaer on 9 Dec 2018
Latest activity Answered by Hossain Ahmed Zobaer on 8 Dec 2019 at 2:07
Hallo Everybody,
I need a little help.
I have a 200*2 matrix, which contains 200 samples of 2 variable. i want to map this dataset in Self Organizing Map. I already did. But i want to have U-Matrix (Unified Distance Matrix), which shows that, which data samples(Variable 1 or 2) clustered in which neuron?
I guess i have to label the dataset. But how can i label my dataset?
What is the matlab command to test a dataset in a trained SOM network?
I am using MATLAB 2017a.
I will be very greatful if someone help me to get out of this prolam.
Thank you in anticipation.
with Regards
Zobaer

  0 Comments

Sign in to comment.

2 Answers

Answer by Filipe Fernandes on 24 Jun 2019

If you have the target of each sample, you can use only the text of the function. This function will plot a string or character in any desired position. Here an example using iris dataset
% Load dataset
[input, Target] = iris_dataset;
[~, Target] = max(Target);
net = selforgmap();
% training
net = train(net, input);
plotsomnd(net,input);
% position (x y) of the center of each neuron
pos = net.layers{:}.positions;
output = net(input);
for cont = 1 : length(pos)
samples = find(output(cont,:));
if ~isempty(samples)
TargetSamples = unique(Target(samples));
text(pos(1,cont),pos(2,cont),num2str(TargetSamples))
end
end
teste.png
I hope I have answered your question.

  0 Comments

Sign in to comment.


Answer by Hossain Ahmed Zobaer on 8 Dec 2019 at 2:07

If you already know the label of histirical data, then you can just make an cell array and labeled them as the historical dataset. Then you can train them with SOM and can find the node positions.
With Regards
Zobaer

  0 Comments

Sign in to comment.