MLBazaar / MLPrimitives

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

Add primitive to make window_sequences based on cutoff times #217

Closed csala closed 4 years ago

csala commented 4 years ago

We already have the timeseries_preprocessing.rolling_window_sequences primitive, which creates an array of 2D matrices by rolling a window of fixed size over the time index axis.

However, when working with fixed time training samples, with an associated cutoff_time, this is not enough.

In this issue, a cutoff_window_sequences primitive should be added, which takes as input a timeseries dataframe, a list of cutoff times and a window size, and creates an array of matrices, each one ending right before the cutoff time.