Potentially unneeded data copying

Abierto
#457 8 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
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
34/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
pandas, python
Área
performance

Línea de trabajo

Start at feature_engine/dataframe_checks.py, in check_X around line 50. Trace its callers such as CountFrequencyEncoder and the related tests to see where copies are made, then run the transformer test suite before and after any change. Done means check_X no longer forces a full copy, the user's original frame stays unmodified, and tests plus a memory check confirm the behavior.

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

Descripción

There is a function check_X used throughout the library which produces a copy of the data in order to avoid potential in-place modifications:
https://github.com/feature-engine/feature_engine/blob/248465e111416f88a4784b5e2e13a83d47e1f00e/feature_engine/dataframe_checks.py#L50

This is inefficient since it generates an extra copy of the whole data, and as a given transformer such as CountFrequencyEncoder processes that data further, a third copy will be generated until it replaces the earlier copy. It is possible to modify data frames column-by-column without having to produce an extra copy of the data and without affecting the original object that is passed by the user by using pd.DataFrame.assign, which could potentially result in a significant decrease in memory usage in large datasets and a small speed up.

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.