Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: Lag or windows features grouped by #668

Open
scardonal opened this issue May 19, 2023 · 1 comment
Open

New feature: Lag or windows features grouped by #668

scardonal opened this issue May 19, 2023 · 1 comment

Comments

@scardonal
Copy link

Is your feature request related to a problem? Please describe.
For example, you want to create lag features of sales for a retail chain, but taking into account the stores, product categories, and date. It's widespread to create lag features taking into consideration the hierarchy or grouping levels.

Describe the solution you'd like
I would like the la feature creation but apply groups by different columns in the data frame.

Describe alternatives you've considered
An alternative solution would be to create a sklearn transformer class to apply the groupby and lag functions of pandas.

Here is an example of what I'm talking about using pandas: https://www.statology.org/pandas-lag-by-group/

@candalfigomoro
Copy link

I have time series identified by an id column, and I would also need to create lag features for each group id.

Moreover, in addition to the id column, it would be useful to be able to pass the name of a column to use for sorting within each group (e.g., a datetime column) instead of just having the "sort_index" parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants