[FEATURE] Categorical Feature Embedding via MLP

Offen
#432 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
18/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet

Rechercherichtung

The request is to add a categorical encoder built on sklearn's MLPClassifier or MLPRegressor, using the hidden layer output as the encoding. Start from the existing categorical encoders in feature_engine/encoding and their shared base class to match the fit/transform API. The proposal lives in an external repository, and the issue thread has no maintainer decision, so confirm scope before writing code. Done means an encoder class with tests and docs that follows the library's conventions.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Using an Embeddinglayer of a deep neural network to encode categorical variables is a common practice also known as "entity embedding". One problem is, that you have to install a deeplearning library like pytroch or tensorflow to implement the neural network with an embedding layer and they are heavy libraries.

One alternative approach could be to use the MLPClassifier, MLPRegressor class from sklearn.neural_network build a neural network of your choice and use the last layer before the classification head to encode categorical variables. One could encode each variable alone or input more variable at once to encode so that the interactions can be found by the neural network.

I have coded this feature and you can take a look at mlpencoder. I would implement this feature in feature engine if you agree.

Examples: https://github.com/Pacman1984/mlpencoder/blob/master/mlpencoder/test.ipynb

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.