[ENH] Automatically convert non-string categorical data in attributes_arff_from_df
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
Locate the Python entry point for attributes_arff_from_df and inspect how categorical columns currently reject non-string values. Exercise it with a pandas DataFrame whose categorical values are integers, then verify that the conversion succeeds and produces string nominals instead of raising the current ValueError.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
Currently, attributes_arff_from_df raises a ValueError if a pandas DataFrame contains a categorical column with non-string values (e.g., integers [0, 1]). The user is forced to manually cast these to strings before passing the DataFrame.
Describe the solution you'd like
Instead of raising an error immediately, the function should attempt to automatically convert the categories to strings using .astype(str). This improves UX for users working with mixed-type or integer-encoded categorical data.
Describe alternatives you've considered
Keep raising the error, but improve the message. However, automatic conversion is more user-friendly as ARFF expects string nominals anyway.
Additional context
I have a fix implemented locally and can submit a PR.
- Ngôn ngữ chính
- Python
- Star
- 361
- Fork
- 296
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của openml/openml-python
-
Documentation Good First Issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
openml/openml-python#1708 · 6 bình luận ·
-
Good First Issue module:Run testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openml/openml-python#1646 · 7 bình luận · 2 reaction ·
-
Good First Issue module:Data testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openml/openml-python#1644 · 4 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
openml/openml-python#1714 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
openml/openml-python#1711 · 1 bình luận ·
Tất cả issue của openml/openml-python
Issue tương tự
-
货币战争手改优先级配置缺少列表元素类型校验(P3) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Đang mởarea: ci bug perceived difficulty: 3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ClickHouse/clickhouse-connect#1057 ·