How to train data using SOM and map the resukts on data

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.

4 件のコメント

KSSV
KSSV 2019 年 4 月 12 日
Its very important and urgent also. That case you should do it on your own...
I am stuck in how to train data using SOM : where you have stuck?
AS
AS 2019 年 4 月 12 日
Yes, I am trying to solve it. But still not getting solution. How to map the classified classes which I have got after application of SOM on real data using som_colorcode.
KSSV
KSSV 2019 年 4 月 12 日
What approach you have used? gui or code? what? Show us code.
AS
AS 2019 年 4 月 12 日
Using Somtoolbox. The data has been classified into 4 classes. But I dont know how to map these classes using som_colorcode on data. So that I will get the classes depth wise. If you have any idea please help me in this

サインインしてコメントする。

回答 (2 件)

KSSV
KSSV 2019 年 4 月 12 日

0 投票

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 件のコメント

Adam
Adam 2019 年 4 月 12 日
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.
AS
AS 2019 年 4 月 12 日
編集済み: AS 2019 年 4 月 12 日
Sir, thanking you for your advice in the form of code . This one is working in your example but not on my data. Previous I have tried this one that time also it was not working on my data. Here I am attaching file. In the data file, dimension is 100 by 31, where trhe last one is depth value. Finally, after apllication of SOM I want to map the classification on data with depth. So, that I can see at which depth which class is present. But, I am unable to do this. Please help me to solve this....
KSSV
KSSV 2019 年 4 月 12 日
How many griups you want?
AS
AS 2019 年 4 月 12 日
5 classes I want
KSSV
KSSV 2019 年 4 月 15 日
編集済み: KSSV 2019 年 4 月 15 日
[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
Adam 2019 年 4 月 15 日
Why train for 1 epoch only? I would think you'd need a few hundred, especially with coverSteps explicitly set at 100
KSSV
KSSV 2019 年 4 月 15 日
Yes.....a typo error.......edited now....

サインインしてコメントする。

AS
AS 2019 年 4 月 15 日

0 投票

It is not working properly. For I have simply calculated best matching unit after training which gives proper classification. And epoch I have used 200

カテゴリ

ヘルプ センター および File Exchange で Deep Learning Toolbox についてさらに検索

タグ

質問済み:

AS
2019 年 4 月 12 日

回答済み:

AS
2019 年 4 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by