Skip to content

Commit

Permalink
use 0-1 error instead of squared error
Browse files Browse the repository at this point in the history
  • Loading branch information
li-xin-yi committed Feb 18, 2015
1 parent 0177ebf commit 7d23b05
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions quiz4/predict_check_nnet.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
re=0;
N=length(test);
for i=1:N
predict=tanh(w2'*[1;tanh(w1'*[1,test(i,1:2)]')]);
re=re+(test(i,3)-predict)^2;
predict(i,1)=sign(tanh(w2'*[1;tanh(w1'*[1,test(i,1:2)]')]));
end
re=re/N;
re=sum(sign(abs(predict-test(:,3))))/N;
end

0 comments on commit 7d23b05

Please sign in to comment.