How to train data using SOM and map the resukts on data
Mostra commenti meno recenti
Pleases help me. I am stuck in how to train data using SOM and map the results on data. I am using the data file, having dimension 100 by 30. First, I want to apply som to train it and them classify the classes.Please help me to solve this problem. Its very important and urgent also.
Risposte (2)
KSSV
il 12 Apr 2019
Hope this demo might help you:
X = rands(2,1000); % some random input
plot(X(1,:),X(2,:),'+r')
net = selforgmap([2 2]); % divide into four groups
net = configure(net,X);
plotsompos(net)
net.trainParam.epochs = 1;
net = train(net,X);
plotsompos(net)
% Groups
Y = vec2ind(net(X)) ;
scatter(X(1,:),X(2,:),30,Y,'filled')
% Testing
x = [0.5;0.3];
y = vec2ind(net(x)) % the give input belongs to this group
7 Commenti
Adam
il 12 Apr 2019
This relies on you having the Deep Learning toolbox in Matlab. If you are using a 3rd party toolbox as you seem to be then it depends how good it is, whether it works or not, how it is implemented, etc.
KSSV
il 12 Apr 2019
How many griups you want?
AS
il 12 Apr 2019
[num,txt,raw] = xlsread('C:\Users\srinivas\Downloads\data100.xlsx') ;
X = num' ;
dimensions = [1 5];
coverSteps = 100;
initNeighbor = 1;
topologyFcn = 'gridtop';
distanceFcn = 'linkdist';
% define net
net = selforgmap(dimensions,coverSteps,initNeighbor,topologyFcn,distanceFcn);
net = configure(net,X);
plotsompos(net)
net.trainParam.epochs = 100;
net = train(net,X);
plotsompos(net)
% Groups
Y = vec2ind(net(X)) ;
Adam
il 15 Apr 2019
Why train for 1 epoch only? I would think you'd need a few hundred, especially with coverSteps explicitly set at 100
KSSV
il 15 Apr 2019
Yes.....a typo error.......edited now....
AS
il 15 Apr 2019
0 voti
Categorie
Scopri di più su Startup and Shutdown in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!