predict-idlab / tsflex

Flexible time series feature extraction & processing
https://predict-idlab.github.io/tsflex/
MIT License
400 stars 26 forks source link

Q: how to calculate features on rolling windows but with fixed start point for each window? #100

Open saheel1115 opened 1 year ago

saheel1115 commented 1 year ago

Hi folks,

Firstly, grateful to you for creating this library. It has crucial features missing in other libraries and I love it so far.

I seek your help in figuring out:

Data: Index Sales
2023-01-02 4
2023-01-09 3
2023-01-16 7
2023-01-23 5

Output should be something like this:

Features considering only 1st week of data: Index Sales Length MeanSales
2023-01-02 4 1 4
Features considering first 2 weeks of data: Index Sales Length MeanSales
2023-01-09 3 2 3.5
Features considering first 3 weeks of data: Index Sales Length MeanSales
2023-01-16 7 3 4.67
Features considering first 4 weeks of data: Index Sales Length MeanSales
2023-01-23 5 4 4.75

Thanks in advance, Saheel.

saheel1115 commented 1 year ago

Update:

I am currently using this solution to achieve what I want:

fc.calculate( data=[df], include_final_window=True, segment_end_idxs=df.index[1:] )



Is there a better solution? 😃