feat: Kmeans Encode Categorical Feature

Aperta
#291 11 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python, scikit-learn

Direzione di ricerca

The issue asks for a KmeansEncoder transformer that fits a scikit-learn KMeans on the input variables and appends the predicted cluster label, with a rough fit/transform sketch in the body. The payload names no existing files, so locate the project's existing transformers and their tests first to match the conventions. Open questions remain: how the cluster count is chosen (the sketch hardcodes 6), and whether the label is a new column. Done means a tested transformer that follows the library's fit/transform pattern, after the design is agreed with maintainers.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is your feature request related to a problem? Please describe.

From Kaggle

The motivating idea for adding cluster labels is that the clusters will break up complicated relationships across features into simpler chunks. Our model can then just learn the simpler chunks one-by-one instead having to learn the complicated whole all at once.

Describe the solution you'd like

A KmeansEncoder transformer that takes as input a set of variables X and return the corresponding cluster label. A basic structure is show below.

class KmeansEncoder:

    def fit(X, y=None):
        self.kmeans_ = KMeans(n_clusters=6)
        self.kmeans_.fit(X)

    def transform(X, y=None):
        X['Cluster'] = self.kmeans_.predict(X)
        return X
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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di feature-engine/feature_engine

Tutte le issue di feature-engine/feature_engine

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.