-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store categories from pandas. #11303
Conversation
I need to either find a fix for the hang or disable the test. |
@@ -1240,6 +1251,70 @@ def get_quantile_cut(self) -> Tuple[np.ndarray, np.ndarray]: | |||
assert data.dtype == np.float32 | |||
return indptr, data | |||
|
|||
def get_categories(self) -> Optional[Dict[str, "pa.DictionaryArray"]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might one day generalize this into an arrow encoder/decoder
. For now, it's just glue code.
@@ -718,6 +720,56 @@ XGB_DLL int XGDMatrixGetStrFeatureInfo(DMatrixHandle handle, const char *field, | |||
API_END(); | |||
} | |||
|
|||
XGB_DLL int XGBDMatrixGetCategories(DMatrixHandle handle, char const **out) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is hidden due to WIP.
- Change host columnar adapter to receive categories. - Store categories in the meta info. - Glue code for the Python interface.
DMatrix
.Other DMatrix types are not supported yet.