Clear Filters
Clear Filters

Error percentage calculated in excel and matlab not matching. why?

1 view (last 30 days)
I calculated error percentage for actual and predicted after ANN implementation using below code. Same I calculted using excel. both are not matching . why?
x = input';
t = output';
trainFcn = 'trainlm'; % Levenberg-Marquardt backpropagation.
hiddenLayerSize = 30;
net = fitnet(hiddenLayerSize,trainFcn);
net.divideParam.trainRatio = 80/100;
net.divideParam.valRatio = 10/100;
net.divideParam.testRatio = 10/100;
[net,tr] = train(net,x,t);
y = net(x);
e = gsubtract(t,y);
percentage_error = abs(t- y) / abs(t) * 100;

Answers (0)


Find more on Electrical Block Libraries in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!