www.pudn.com > Kdd-DT-NN.rar > NN_evaluation.m, change:2016-02-01,size:320b


function [er] = NN_evaluation(net,X,Y) 
Output = sim(net,X); %Computation of the network outputs 
 
[~,N]=size(X); 
er=0; 
for i=1:1:N 
  [~,index]=max(Output(:,i)); 
  predict=index; 
  a=find(Y(:,i)==1); 
  realclass=a(1); 
   
  if(predict~=realclass) 
   er=er+1;    
  end 
end 
er=er./N; 
%compute the error rate