Skip to content

Conversation

@trivialfis
Copy link
Member

No description provided.

@trivialfis trivialfis changed the title Expose the categories container to C. [enc] Expose the categories container to C. Nov 6, 2025
@trivialfis trivialfis requested a review from Copilot November 6, 2025 18:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR moves experimental category-related API functions from hidden/internal status to the public C API header, making them officially available as of version 3.2.

Key changes:

  • Moved CategoriesHandle typedef from implementation file to public header
  • Relocated comprehensive documentation for XGDMatrixGetCategories, XGDMatrixGetCategoriesExportToArrow, and XGBCategoriesFree from implementation to header
  • Added public declarations for XGBoosterGetCategories and XGBoosterGetCategoriesExportToArrow with proper documentation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/c_api/c_api.cc Removed documentation comments for category functions that were moved to the public header, cleaned up internal comments
include/xgboost/c_api.h Added CategoriesHandle typedef, comprehensive documentation for all category-related functions with @since 3.2 tags and experimental API notes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hcho3
Copy link
Collaborator

hcho3 commented Nov 6, 2025

Can you give me some more context on this PR? I thought the Booster object already supported exporting the categories container as Arrow arrays? How does this PR change things?

@trivialfis
Copy link
Member Author

trivialfis commented Nov 7, 2025

Can you give me some more context on this PR?

I hid the C functions in the last release in case of unexpected issues. It took me a while to figure out all the states, like whether one needs to re-code data during training continuation, and when input is a DMatrix. This PR exposes these functions to the C header, but they are still marked as experimental.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants