Skip to content

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

Closed
cakedev0 wants to merge 3 commits into
mainfrom
gb-categorical
Closed

cakedev0 wants to merge 3 commits into
mainfrom
gb-categorical

Conversation

@cakedev0

@cakedev0 cakedev0 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Reference Issues/PRs

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

Towards unifying GB and HGB (scikit-learn#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 scikit-learn#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)

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]>
@cakedev0
cakedev0 changed the base branch from shared-validation-trees to main December 2, 2026 12:59
@cakedev0

cakedev0 commented Dec 2, 2026

Copy link
Copy Markdown
Owner Author

Opened upstream as scikit-learn#35603.

@cakedev0 cakedev0 closed this Dec 2, 2026
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.

1 participant