필터 지우기
필터 지우기

Calculation MAPE (Mean Absolute Percentage) except for some values

조회 수: 42 (최근 30일)
Perihan Bilgeç
Perihan Bilgeç 2019년 2월 11일
답변: Luciana Reys 2021년 5월 10일
Hi everyone;
I am using a function for Neural Network model. In the function as conclusion, I want to calculate MAPE values and I am using the formula above. But I have a problem that Yv vector has 0 (zero) values, as a result this MAPE value shows that 'Infinitive'. I want to calculate MAPE except for 0 (zero) values of Yv vector. For this can I update MAPE formula? Thank you very much.
MAPE= mean((abs(ye-Yv))./Yv)
Yv=Real values vector
ye=Neural Network model's estimated values
  댓글 수: 1
Abdulrahman Haruna
Abdulrahman Haruna 2019년 8월 26일
Dear,
You may just remove the rows where you have the zeros.
e.g.,
indexes = (Yv == 0) %Find teh places where there are zeros
Yv(indexes) = []; %remove them from Yv
Ye(indexes) = []; % remove similar points in Ye
Then you proceed ):

댓글을 달려면 로그인하십시오.

답변 (1개)

Luciana Reys
Luciana Reys 2021년 5월 10일
Hello,
You can also use only finite numbers.
pre_MAPE = abs((ye-Yv)./Yv);
MAPE = mean(pre_MAPE(isfinite(pre_MAPE)));

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by