arundo / adtk

A Python toolkit for rule-based/unsupervised anomaly detection in time series
https://adtk.readthedocs.io
Mozilla Public License 2.0
1.06k stars 143 forks source link

Seasonal Decomposition for Multivariate time series #114

Closed nbrosse closed 3 years ago

nbrosse commented 3 years ago

I fit seasonal detector and transformer to a multivariate time series following the documentation.

https://adtk.readthedocs.io/en/stable/api/transformers.html#adtk.transformer.ClassicSeasonalDecomposition

https://adtk.readthedocs.io/en/stable/notebooks/demo.html#SeasonalAD

When I fit a pandas Dataframe with several columns (multivariate time series) to these detector/transformer, the seasonal_ component does not exist anymore.

Would it be possible to get a seasonal_ dataframe in that case ?

tailaiw commented 3 years ago

@nbrosse Right now there is no pretty way to do so. Maybe something in the future.

When a univariate model is applied to a multivariate series, what happens behind the scene is a list of models is initiated and each is assigned to a channel. You may access all models on the backend by _models attribute of your model. For each model in that list, I think you can get seasonal_. Let me know if that works.

nbrosse commented 3 years ago

Thank you @tailaiw ! It works ! It would be maybe a nice feature to add in the future, Thanks again :)