feat: Kmeans Encode Categorical Feature

Abierto
#291 11 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python, scikit-learn

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Python
Estrellas
2.3k
Forks
391
Merge medio
11 h 34 min
PR fusionados (30 d)
11

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de feature-engine/feature_engine

Todos los issues de feature-engine/feature_engine

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.