clear all
TrainSet=load('data\breast_train.dat');
TestSet=load('data\breast_test.dat');

% form x,y
x=TrainSet(:,1:9)';
y=TrainSet(:,10)';
% Training
M=input('keyin the number of hidden units:');
[E,NetDef,W1,W2]=noisecan(x',y',M);
[Y_sim,E,PI] = nneval(NetDef,W1,W2, x, y,1); 

% form x_test, y_test
x_test = TestSet(:,1:9)';
y_test = TestSet(:,10)';
%testing
[Y_sim,E,PI] = nneval(NetDef,W1,W2, x_test, y_test,1);
fprintf('\n MSE for testing %f\n',mean(E.^2));
fprintf(' ME for testing %f',mean(abs(E)));
fprintf(' Error predictions %f',sum(abs(E)>0.45));