SOM neural network help - for classifying data- yes, it can be done
Show older comments
I am following a paper to classify 3 sets of data. I am concentrating on Self-organising maps. Though supervised ones will be better. The only problem is that I am unable to get accurate results. While using nntool (gui) too, the results vary completely on successive trainings. Even the data which is used to construct the map, whn tested, hasnt been properly classifies by the map. I am using the following code after giving up on GUI::
L=250;
net=newsom(MVin,[1 2],'hextop','linkdist',L,2);
plotsom(net.iw{1,1},net.layers{1}.distances);
net.trainParam.epochs=200;
net.trainFcn='trainr';
net = train(net,MVin,Target);
a=vec2ind(sim(net,MVtest));
P=max(a);
n=0;
while(P==2)
n=n+1;
net=newsom(MVin,[1 2],'hextop','linkdist',L,2);
net.trainParam.epochs=200;
net.trainParam.show=Inf;
net.trainFcn='trainr';
net=train(net,MVin,Target);
a=vec2ind(sim(net,MVtest));
P=max(a);
end
n is for no of times training has been done P is set for 2, because the MVtest data belongs to 1 category Also this code is for calssifying only 2 sets for now.
The problem :1) it runs for 100 iterations even after specifying 200 2) It runs endlessly, cant cancel or stop!
I have also downloaded som-toolbox, but I am not familiar with the syntax of all the functions available. Help in this field will also be appreciated.
PS: please avail yourselves to me for counter questions. I shall be grateful.
Accepted Answer
More Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!