Self Organizing Map (SOM) recognising 'unseen' data - Kohonen's SOM

조회 수: 6 (최근 30일)
Vineet Guru
Vineet Guru 2013년 5월 23일
Hi, Having successfully employed Kohonen's SOM (ver 1)for classification (as in I managed to classify training data such that the Best Matching Neuron is correctly associated with all data that have similar features). I now want to use this saved SOM to correctly recognise 'unseen' data without re-training the SOM again.
I understand some might be of the view that Kohonen's SOM is good for visualisation only. But if my experiment with classification worked, as described above, surely there should be a way to use this trained map to recognise 'new' data and accordingly exhibit which Neuron it is best associated with.
Hence would it be possible for someone familar with the SOM-PAK code to help me with this. Below is what I have tried but it does not work as intended.
load('SOM_trained.mat') % this contains the trained SOM and all other variables
B = xlsread('newdata.xlsx'); % this reads the new data into an array
m = (num_A+1); %this increments the max data size of the trained SOM by one, num_A was the max size and is contained int he loaded .mat file
sDataStr_rec = som_data_struct(B);
sDataStr_rec=som_normalize_data(sDataStr_rec,'som_var_norm');
sMaptest = som_train(sMaptest,sDataStr_rec, 500); %SMaptest is the Trained SOM loaded from the .mat file
som_show(sMaptest,1);
for p = 1:m
sDataStr_rec.labels{p} = strcat(num2str(m)); %Associating an Index number for each input
end
sMapnew=som_autolabel(sMaptest,sDataStr_rec,'add');
som_addlabels(sMapnew,'all','all',[],'k');
colormap(jet(12));
som_recolorbar
X = size (sMapnew.labels,2);
Y = size (sMapnew.labels,1);
rec_bmu = som_bmus(sMapnew, sDataStr_rec);
At this point rec_bmu should to point to the the Best Matched Neuron for the new 'unseen' data. This does not happen. Can anyone figure out my mistake.
Thanks.

채택된 답변

Vineet Guru
Vineet Guru 2013년 6월 1일
I have sorted this out.
Many thanks for those who attempted an answer.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Classification에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by