dmlc / dmlc/xgboost

ArrayInterface handler for cuDF DataFrame cannot yet handle Boolean columns

Open
#10,181 1 comment 0 reactions 0 assignees View on GitHub
feature-request
Dominant language
C++
Stars
28.8k
Forks
8.9k
Avg merge
1d 12h
Merged PRs (30d)
54

Description

Since the `ArrayInterface` class in XGBoost does not yet support Boolean columns, it throws an error
```
/workspace/src/c_api/../data/array_interface.h:500: Boolean-1 is not supported.
```
whenever Boolean columns are passed in. The error is only relevant for cuDF DataFrames, since [the handler for Pandas DataFrame converts Boolean columns into float type](https://github.com/dmlc/xgboost/blob/732e27cebc0c4085d0d9cc57f278c531cf68a8b0/python-package/xgboost/data.py#L475).

Context. I encountered this error while working on #10175. Starting from Pandas 2.0, `pd.get_dummies()` returns Boolean type, instead of uint8 (https://github.com/pandas-dev/pandas/pull/48022).

Contributor guide

No contributing guide indexed for this repository

Research direction

Read src/c_api/../data/array_interface.h around the reported line and the linked Python handling in python-package/xgboost/data.py. Reproduce the failure with a cuDF DataFrame containing Boolean columns, then trace the existing ArrayInterface type handling and relevant tests. Done means Boolean columns are accepted without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
data, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.