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
457 stars 73 forks source link

Croston implementation is slow #182

Closed antoinecarme closed 2 years ago

antoinecarme commented 2 years ago

Croston Method uses a simple exponential smoothing internally. This is implemented using a loop on the data in python (not a valid pyaf philosophy, even if we are only looping on non-zero rows ;).

https://github.com/antoinecarme/pyaf/blob/f3853d1bef5a95a3c61cbbd06f5ab0bb8979e383/pyaf/TS/Intermittent_Models.py#L96

Try vectorizing this loop, or better, use statsmodels implementation and avoid reinventing the wheel.

https://github.com/statsmodels/statsmodels/

A profiling is needed to assess the speed improvement.

Target Release : 2022-07-14

antoinecarme commented 2 years ago

reminder : add statsmodels as pyaf dependency.

antoinecarme commented 2 years ago

Speed improvement OK.