Fix RandomForestRegressor default max_features#6862
Merged
rapids-bot[bot] merged 1 commit intorapidsai:branch-25.08from Jun 10, 2025
Merged
Fix RandomForestRegressor default max_features#6862rapids-bot[bot] merged 1 commit intorapidsai:branch-25.08from
max_features#6862rapids-bot[bot] merged 1 commit intorapidsai:branch-25.08from
Conversation
3 tasks
hcho3
approved these changes
Jun 5, 2025
csadorf
requested changes
Jun 5, 2025
Contributor
csadorf
left a comment
There was a problem hiding this comment.
Thanks for the catch and the quick fix!
Can you add a unit test that would captures this bug, please?
This was a bug introduced with the removal of `max_features="auto"`. The default value for `RandomForestRegressor` should be `1.0`, while the default for `RandomForestClassifier` should be `"sqrt"`. They were both erroneously set to `"sqrt"`.
9401869 to
3175146
Compare
Member
Author
Done. I originally hadn't added a test since it felt a bit silly to check that the defaults were the defaults, but it was easy to add and fine if it gives us peace-of-mind. |
Contributor
Thanks a lot. I think the very existence of the bug demonstrates that it's not silly. ;) |
csadorf
approved these changes
Jun 10, 2025
Member
Author
|
/merge |
72953a8
into
rapidsai:branch-25.08
177 of 181 checks passed
rapids-bot Bot
pushed a commit
that referenced
this pull request
Jun 11, 2025
This ports `RandomForestClassifier` and `RandomForestRegressor` to subclass from `InteropMixin` and `ProxyBase`. Fixes #6707. Todo: - [x] Rebase on top of #6854, #6862, and #6873 - [x] Add interop tests in `test_sklearn_import_export.py` - [x] Update xfail list Authors: - Jim Crist-Harif (https://github.com/jcrist) Approvers: - Simon Adorf (https://github.com/csadorf) URL: #6863
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was a bug introduced with the removal of
max_features="auto". The default value forRandomForestRegressorshould be1.0, while the default forRandomForestClassifiershould be"sqrt". They were both erroneously set to"sqrt".