feat: Group Transformer
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- pandas, python, scikit-learn
- Ambito
- data, machine-learning
Direzione di ricerca
The issue names no files, so start by locating where the library's existing sklearn-compatible transformers are defined and how they follow fit and transform. The proposal is a GroupTransform that stores per-category aggregates in fit and merges them back in transform, but it leaves open whether inputs are DataFrames or ndarrays, and how unseen categories are handled. Settle those choices with the maintainers first; done means a fitted transformer returns the grouped aggregate merged onto the input, with tests for the chosen behaviour.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
Aggregating variables by a single or multiple category is a simple task
df.groupby('cat')["num_var"].transform("mean")
however to make it compatible with a Sklearn Pipeline, a Transformer with some requirements is needed. Feature Engine could provide a transformer with these functionality.
Describe the solution you'd like
A GroupTransform class with a fit() that stores that computes and stores the aggregated information
and a transform method that merges this information.
Class GroupTransform:
def fit(X, y=None):
self.X_agg_ = X.groupby('cat')["num_var"].transform("mean")
def transform(X, y=None):
X.merge(self.X_agg_)
Describe alternatives you've considered
To make it 100% compatible with sklearn the fit and transform methods should takes as input an ndarray.
To pass the information to a new dataframe the merge method is needed.
- Lingua principale
- Python
- Stelle
- 2.3k
- Fork
- 391
- Merge medio
- 11h 34m
- PR unite (30g)
- 11
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di feature-engine/feature_engine
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
feature-engine/feature_engine#1141 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
feature-engine/feature_engine#393 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
feature-engine/feature_engine#1140 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
CategoricalImputer fails when fill_value is already a categoryForse già presa @AryanRG l’ha presa 12 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 18/100
feature-engine/feature_engine#1113 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
OneHotEncoder loses a dummy name when it matches an encoded input columnForse già presa @Aadrit555 l’ha presa 7 giorni fa. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 25/100
feature-engine/feature_engine#1106 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di feature-engine/feature_engine
Issue simili
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
MakazhanAlpamys/Soup#3589 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ClickHouse/clickhouse-connect#1266 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
biosustain/growthcurves_app#89 ·
I maintainer di solito rispondono entro 1 giorno
-
`LogProxyConsumer._on_relation_departed` raises `APIError` when the promtail service does not existAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
canonical/loki-k8s-operator#695 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno