Potentially unneeded data copying

Đang mở
#457 8 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
34/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
pandas, python
Lĩnh vực
performance

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
2.3k
Fork
391
Merge trung bình
11 giờ 34 phút
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của feature-engine/feature_engine

Tất cả issue của feature-engine/feature_engine

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.