well iam trying to find the training error and test error of a database
something is wrong whit my code cause y1 and y2 arry are all 1 but i dont know what is the problem can someone tell me how else can i find the test error i tried H = numel(find(trainingset' ==y1)) but this error came up Error using ==
Matrix dimensions must agree.
clcclear allclose allfilename='FIFA5.xlsx';A =xlsread(filename);[m,n]=size(A);T= A(:,1);data= A(:,(2:end));rows80=int32(floor(0.8 * m));trainingset=A(1:rows80,:);testset=A(rows80+1:end,:);t=trainingset(1:rows80,1);t_test=A(rows80+1:end,1);net= newff(trainingset',t');y=sim(net,trainingset');%net.trainParam.epoch=20;
net= train(net,trainingset',t');y=sim(net,trainingset');y_test=sim(net,testset'); p=0; y1=hardlim(y'); y2= hardlims(y_test); for(i=1:size(t,1)) if(t(i,:)==y1(i,:)) p=p+1; end end trainerror =100*p/size(trainingset,1); e=0; y2=hardlim(y_test'); for(j=1:size(t_test,1)) if(t_test(j,:)==y2(j,:)) e=e+1; endend testerror=100*e/size(t_test,1); %[m, n] = size(trainingset);
%H = numel(find(trainingset' ==y1))
% errTrainNum = m - H;
%
% x = 100 / m;
%
% errorOfTrain = (x * errTrainNum) / 100
%
Best Answer