antoinecarme / pyaf

PyAF is an Open Source Python library for Automatic Time Series Forecasting built on top of popular pydata modules.
BSD 3-Clause "New" or "Revised" License
456 stars 73 forks source link

Use MASE by default for PyAF Model Selection #229

Closed antoinecarme closed 1 year ago

antoinecarme commented 1 year ago

When the signal contains zeros, the MAPE values are not defined. MAPE is simply not suitable for such signals ans this can lead to low quality models.

https://stackoverflow.com/questions/41571215/forecasr-accuracy-mape-and-zero-values

https://otexts.com/fpp3/accuracy.html

There is no technical work-around for better using MAPE.

MAPE is not suitable for reporting performance measure values when zeros in the signal, but it is very user-friendly and easy to understand..

The only solution is to use a scaled measure like MASE for model selection by default.

Some benchmarking is needed (#222 ).

It would be nice to have this in PyAF 5.0 (expected on 2023-07-14). So far, so good. DONE.

antoinecarme commented 1 year ago

https://otexts.com/fpp3/accuracy.html

https://www.sciencedirect.com/science/article/abs/pii/S0169207006000239?via%3Dihub

Another look at measures of forecast accuracy Author: Rob J. Hyndman, Anne B. Koehler Publication: International Journal of Forecasting Publisher: Elsevier Date: October–December 2006

image

antoinecarme commented 1 year ago

Also add the same scaling for RMSE, the RMSSE as a new performance measure :

https://otexts.com/fpp3/accuracy.html

image

antoinecarme commented 1 year ago

Origin : user model on google colab (#PyAF hashtag rocks ;).

https://colab.research.google.com/drive/1zaVQuobR8M63qB-UDDX8ZX37ctl98YIT?usp=sharing

antoinecarme commented 1 year ago

Original Model (MAPE)

image

antoinecarme commented 1 year ago

Same Model with MASE

image

antoinecarme commented 1 year ago

Same Model with RMSE (L2)

image

antoinecarme commented 1 year ago

Same Model with RMSSE (scaled RMSE)

image

antoinecarme commented 1 year ago

The prediction intervals plots now gives the values of MAPE and MASE for horizon 1 and horizon H by default.

image

antoinecarme commented 1 year ago

CLOSING. Added to 5.0