New feature: Lag or windows features grouped by

Offen
#668 2 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

  • #1109 von @lcrmorin — ohne Merge geschlossen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
18/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
pandas, python

Rechercherichtung

The issue asks for lag and window features to be computed per group, using the pandas groupby-then-lag pattern as the reference. Work is already under way in linked pull request #1109, so read that PR first to see what it covers before starting. The issue text names no files, so locate the existing lag-feature transformer in the repository. Done means grouping by one or more columns works and the tests pass.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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/

Vorherrschende Sprache
Python
Sterne
2.3k
Forks
391
Ø Merge
11 Std. 34 Min.
Gemergte PRs (30 T.)
11

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus feature-engine/feature_engine

Alle Issues in feature-engine/feature_engine

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.