Skip to content

ENH change default scoring to log loss in LogisticRegressionCV - #33333

Merged
OmarManzoor merged 18 commits into
scikit-learn:mainfrom
lorentzenchr:logregcv_scoring
Mar 16, 2026
Merged

OmarManzoor merged 18 commits into
scikit-learn:mainfrom
lorentzenchr:logregcv_scoring

Conversation

@lorentzenchr

Copy link
Copy Markdown
Member

Reference Issues/PRs

Fixes #33214.

What does this implement/fix? Explain your changes.

This PR changes the default scoring=None, i.e. accuracy, to scoring=neg_log_loss in LogisticRegressionCV.

AI usage disclosure

None

Any other comments?

The failing tests will be fixed, once #32828 gets merged.

@lorentzenchr lorentzenchr changed the title MNT change default scoring to log loss in LogisticRegressionCV ENH change default scoring to log loss in LogisticRegressionCV Feb 20, 2026
@ogrisel

ogrisel commented Feb 23, 2026

Copy link
Copy Markdown
Member

I triggered a sync with main to see if it fixes the doc CI.

@ogrisel ogrisel 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.

I think it makes sense to align the outer and the inner objective functions of this model.

I wonder if d2_log_loss wouldn't be a slightly nice choice for users inspecting the scores_ attribute of the fitted estimator but no strong opinion.

Comment thread sklearn/linear_model/_logistic.py Resolved
@ogrisel

ogrisel commented Feb 24, 2026

Copy link
Copy Markdown
Member

Actually, I approved a bit quickly, there are still tests that need an update.

@lorentzenchr

Copy link
Copy Markdown
Member Author

Actually, I approved a bit quickly, there are still tests that need an update.

That fine, isn‘t it. You can trust me to fix the tests.
More important is that you consent to this change.

@lorentzenchr

lorentzenchr commented Feb 26, 2026 •

Copy link
Copy Markdown
Member Author

I have fixed the tests, was more work than I thought.
CI failure is not related to this PR. Ready for approval and merge as far as I am concerned.

@lorentzenchr

Copy link
Copy Markdown
Member Author

@OmarManzoor You might be interested.

@OmarManzoor OmarManzoor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thank you @lorentzenchr
Just a few nits

Comment thread sklearn/linear_model/_logistic.py Resolved
@OmarManzoor
OmarManzoor merged commit 811b588 into scikit-learn:main Mar 16, 2026
33 checks passed
@lorentzenchr

Copy link
Copy Markdown
Member Author

For the interested reader, see the positive effect of this change in #28995 (comment).

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.

RFC change default scoring of LogisticRegressionCV from accuracy to logloss

3 participants