MLBazaar / MLPrimitives

Primitives for machine learning and data science.
https://mlbazaar.github.io/MLPrimitives
MIT License
69 stars 38 forks source link

Accept timedelta window_size in cutoff_window_sequences #239

Closed csala closed 3 years ago

csala commented 3 years ago

The primitive mlprimitives.custom.timeseries_preprocessing only accepts integers as window_size specification:

https://github.com/HDI-Project/MLPrimitives/blob/a592c8446aa614cd9d0eb6c73735d11ebc876129/mlprimitives/custom/timeseries_preprocessing.py#L216

This should be made flexible, so pd.Timedelta objects or the corresponding str specifications can be passed.

As an example, if an X is passed where the time index has a regular frequency of one hour (so, there are 24 data points every day), all these window_size values should be equivalent: