Skip to content

ENH Add categorical features and missing values support to GradientBoosting - #35603

Open
cakedev0 wants to merge 3 commits into
scikit-learn:mainfrom
cakedev0:gb-categorical
Open

cakedev0 wants to merge 3 commits into
scikit-learn:mainfrom
cakedev0:gb-categorical

Conversation

@cakedev0

@cakedev0 cakedev0 commented Dec 2, 2026

Copy link
Copy Markdown
Member

Reference Issues/PRs

Fourth part of the split of #35162, follow-up of #35181.

Towards unifying GB and HGB (#27873).

What does this implement/fix? Explain your changes.

GradientBoostingClassifier and GradientBoostingRegressor now accept categorical_features (default None, "from_dtype" planned as the default in 1.13, like forests) and missing values. GB already validates and encodes X like trees since #35181, so the core changes are really small. The diff mostly comes from doc & tests.

Some notes:

  • Unknown categories at predict time are treated as missing values (same as trees/forests/HGB).
  • warm_start is not supported with categorical features, same as forests: refitting would re-encode the categories and invalidate the splits of the earlier trees.

AI usage disclosure

I used AI assistance for:

  • Code generation (closely guided)
  • Test/benchmark generation
  • Documentation (changelogs)

cakedev0 and others added 3 commits December 2, 2026 13:55
GradientBoostingClassifier and GradientBoostingRegressor accept the
categorical_features parameter and missing values. predict_stages uses
the tree's goes_left to route categorical splits and missing values.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant