how to classify two class using neural network

1 回表示 (過去 30 日間)
tamanna
tamanna 2013 年 4 月 16 日

採用された回答

Greg Heath
Greg Heath 2013 年 4 月 16 日
patternnet
help patternnet
doc patternnet
Hope this helps.
Greg
  3 件のコメント
tamanna
tamanna 2013 年 4 月 30 日
sir..this is the coding i got from somewhere for probabilistic neural network. X = [7.02 1;50.13 5;90.1 9;86.08 9;62 4;59.9 15;35.6 20;35.5 60;70.89 48;40.3 80]';
Tc = [1 2 3 4 5 6 7 8 9 10];
plot(X(1,:),X(2,:),'.','markersize',20)
for i=1:10
text(X(1,i)+0.1,X(2,i),sprintf('class %g',Tc(i))),
end
% axis([0 200 0 200])
title('Ten vectors and their classes.')
xlabel('X(1,:)')
ylabel('X(2,:)')
%.......................................
T = ind2vec(Tc);
spread = 1;
net = newpnn(X,Tc,spread); ........................................%
% Y = sim(net,X,Tc);
% Y = net(X);
Y= X';
Yc = vec2ind(Y);
figure;
plot(X(1,:),X(2,:),'.','markersize',30)
% axis([0 200 0 200])
for i=1:10,text(X(1,i)+0.1,X(2,i),sprintf('class %g',Yc(i))),
end
title('Testing the network.')
xlabel('X(1,:)')
ylabel('X(2,:)')
%......................................%
x = [20; 10.5];
y=x';
% y = net(x);
ac = vec2ind(y);
hold on
plot(x(1),x(2),'.','markersize',30,'color',[1 0 0])
text(x(1)+0.1,x(2),sprintf('class %g',ac))
hold off
title('Classifying y new vector.')
xlabel('X(1,:) and x(1)')
ylabel('X(2,:) and x(2)')
may you tell me what the flow of the program
Greg Heath
Greg Heath 2013 年 5 月 1 日
I have a better idea:
1. Run the program
2. Run again with semicolons removed
3. Study the results
4. If you have any questions, repost with comments before every line you understand and a line of question marks before every line you do not understand.
Greg

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by