Thanks to visit codestin.com
Credit goes to github.com

Skip to content

API Make cv_results_ return the last iteration in successive halving - #34250

Merged
betatim merged 7 commits into
scikit-learn:mainfrom
glemaitre:rework_cv_results_successive_halving
Jun 11, 2026
Merged

API Make cv_results_ return the last iteration in successive halving#34250
betatim merged 7 commits into
scikit-learn:mainfrom
glemaitre:rework_cv_results_successive_halving

Conversation

@glemaitre

@glemaitre glemaitre commented Jun 11, 2026

Copy link
Copy Markdown
Member

While working on the example, it seems that the current API that expect our user to check the last iteration of the halving to inspect ranking is quite surprising.

Instead, I think that we should filter the cv_results_ to the last iteration and add a new all_cv_results_ attribute that would contain all the iteration information.

It is what we discussed with @ogrisel and @jeremiedbb during the IRL sprint discussion.

In addition, we don't add the ranking in the all_cv_results_ which is not useful for any practical cases.

Comment thread sklearn/model_selection/tests/test_successive_halving.py
Comment thread sklearn/model_selection/_search_successive_halving.py Outdated
Comment thread sklearn/model_selection/_search_successive_halving.py
@betatim

betatim commented Jun 11, 2026

Copy link
Copy Markdown
Member

I like it. The current behaviour is confusing enough that a user came and updated the documentation to warn people about this caveat.

I think this is a better solution

Comment thread sklearn/model_selection/_search_successive_halving.py Outdated

@thomasjpfan thomasjpfan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@betatim
betatim enabled auto-merge (squash) June 11, 2026 17:02
@betatim
betatim merged commit 3af3064 into scikit-learn:main Jun 11, 2026
36 checks passed
prady0t pushed a commit to prady0t/scikit-learn that referenced this pull request Sep 2, 2026
@jeremiedbb jeremiedbb mentioned this pull request Sep 8, 2026
14 tasks
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.

3 participants