Filter löschen
Filter löschen

How to calculate MAPE, MAE and SD for LRN neural networl

5 Ansichten (letzte 30 Tage)
Shaheer Ansari
Shaheer Ansari am 12 Nov. 2020
Kommentiert: Shaheer Ansari am 20 Mär. 2021
Dear all,
I am currently using LRN neural network for the prediction and needs to calculate performance indices like MAPE, MAE and SD. As mentioned below, i am trying to calculate from the given formula but i am getting the value in double which is undesirable as the value need to be in an integer form although i am getting the value of other performnance indices like MSE and RMSE in integrer form. Please assist in this regard
lrn_net = layrecnet(1,10);
lrn_net.trainFcn = 'trainlm';
lrn_net.trainParam.show = 5;
lrn_net.trainParam.epochs = 500;
lrn_net = train(lrn_net,data_train,target_train);
y = lrn_net(data_test);
performance = perform(lrn_net,target_test, y)
RMSE = sqrt(performance)
MSE = mse(lrn_net,target_test, y)
MAPE=(sum(abs((y-target_test)./(y)))./length(target_test))*100
MAE=(sum(abs(y-target_test))./length(target_test))*100
SD=(std(y-target_test))*100

Akzeptierte Antwort

Kyle Rawding
Kyle Rawding am 17 Mär. 2021
Hi Shaheer -
To convert from double to int, you could use the uint8 or int8 functions, or another from that family of functions.
For example,
MAPE=uint8((sum(abs((y-target_test)./(y)))./length(target_test))*100);
Hope that helps,
Kyle
  1 Kommentar
Shaheer Ansari
Shaheer Ansari am 20 Mär. 2021
Thank you for your assistance in this regard. It'll be helpful to me in your research work

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by