how to classify two class using neural network

조회 수: 2 (최근 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개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by