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

Optimize seasonal pattern extraction #70

Closed antoinecarme closed 7 years ago

antoinecarme commented 7 years ago

PyAF internally analyzes trend residues for the following seasonal patterns :

self.addSeasonal(trend, "MonthOfYear", self.mTimeInfo.RES_MONTH);
self.addSeasonal(trend, "DayOfMonth", self.mTimeInfo.RES_DAY);
self.addSeasonal(trend, "Hour", self.mTimeInfo.RES_HOUR);
self.addSeasonal(trend, "Minute", self.mTimeInfo.RES_MINUTE);
self.addSeasonal(trend, "Second", self.mTimeInfo.RES_SECOND);
self.addSeasonal(trend, "WeekOfYear", self.mTimeInfo.RES_DAY);
self.addSeasonal(trend, "DayOfWeek", self.mTimeInfo.RES_DAY);

Each of these seasonals is analyzed separately and an AR/SVR/... model is built on its residue.

A possible optimization here is to keep only the best of these (filter out redundant seasonals). This will lead to a reduction of the number of AR models and cpu/memory usage by a factor of (at least) 2.

antoinecarme commented 7 years ago

This can be an option (enabled in fast mode (default), and disabled in slow mode.

antoinecarme commented 7 years ago

We do not expect too much effect on model quality. To be checked in the benchmarks.