Skip to content

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

@saheel1115

Description

@saheel1115

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:

  • how to calculate features on entire time series?
  • how to move the end point of window forward by a fixed amount (say, 1 week) but not move the start of the window? Basically, my data is weekly and I am solving a forecasting problem. I want to calculate time series features for each training sample without data leakage. Thus, for each week, I want to calculate features for the time series till that week; then move on to next week and calculate features for time series till that week; and so on.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions