Skip to content

ENH Allow warm_start with categorical features in RandomForest and ExtraTrees - #35151

Open
adam2392 wants to merge 3 commits into
scikit-learn:mainfrom
adam2392:feat/cat-forest-warm-start
Open

adam2392 wants to merge 3 commits into
scikit-learn:mainfrom
adam2392:feat/cat-forest-warm-start

Conversation

@adam2392

@adam2392 adam2392 commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

HistGradientBoosting* already allows warm_start with categorical features. Forests were rejecting that combination because each fit re-encodes categories. This drops the special-case error so forests behave the same way: re-encode on fit and keep growing the ensemble when warm_start=True.

Follow-up to #34832.

Notes

The problem with this approach is that we intentionally allow categories in features to change as we warm_start build. This is the pattern in HGBT. Do we want that? Xref: #34832 (comment)_.

Related PR that's in flight: cakedev0#18

@adam2392

Copy link
Copy Markdown
Member Author

Do we want alignment with the existing HGBT behavior?

cc: @ogrisel @lorentzenchr @thomasjpfan

@cakedev0

Copy link
Copy Markdown
Member

I think current HGB behavior is buggy/unsafe and should be fixed first. Then we can consider supporting categorical + warm start in RF/ET.

@adam2392

Copy link
Copy Markdown
Member Author

I think current HGB behavior is buggy/unsafe and should be fixed first. Then we can consider supporting categorical + warm start in RF/ET.

Kay, let's transition over to your PR then? I think that's the logical next step. Feel free to ping me and bother me for reviews.

@cakedev0

Copy link
Copy Markdown
Member

Yes 😄 I just finished polishing it. The diff size might look scary at first, but it's actually not that hard to review I think.

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.

2 participants