facebook / prophet

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.
https://facebook.github.io/prophet
MIT License
18.01k stars 4.48k forks source link

Fix Issue #2577 - Zero Division Error in diagnostics.performance_metrics() causing failed assertion #2578

Closed ThomasChia closed 1 month ago

ThomasChia commented 2 months ago

This PR resolves Issue #2577

This issue is caused by zero division leading to np.nan values, so this PR adds a fix by filling np.nan values with zero during the calculation of the SMAPE metric.

This PR also updates the test_performance_metrics() method in the TestPerformanceMetrics class in tests.test_diagnostics.py to cover all metrics handling zero values for y and yhat.