How to label unlabeled data(e.g. 200*2 matrix) in Self Organizing Map?
Show older comments
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
Accepted Answer
More Answers (1)
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

I hope I have answered your question.
Categories
Find more on Axis Labels in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!