8000 [MRG] Fixed bug in _log_reg_scoring_path for multinomial case by NicolasHug · Pull Request #11724 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG] Fixed bug in _log_reg_scoring_path for multinomial case #11724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 2, 2018

Conversation

NicolasHug
Copy link
Member

Reference Issues/PRs

What does this implement/fix? Explain your changes.

This PR fixes a weird bug in logistic_regression_path that makes _log_reg_scoring_path give an incorrect output. Prior to this change, all the scores (from the different C values) would have been the same.

Any other comments?

I stumbled upon this while working on #11646.

To be fair I suspect that there are other bugs.

Related but not part of this PR: the doc of logistic_regression_path says that the coefs attribute is of shape (n_cs, n_features) but that's not true when multiclass=multinomial. Should I update the doc? Or is the actual code that is wrong?

Copy link
Member
@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

Yikes! This is a nasty one... Well spotted. Add a what's new entry, please



def test_log_reg_scoring_path_multinomial():
# Make sure that the scores are all different for different C values
Copy link
Member

Choose a reason for hiding this comment

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

At the moment you are only checking that some are different. And if so, you only need to test two values of C

@TomDLT
Copy link
Member
TomDLT commented Aug 2, 2018

Good catch, thanks !

@TomDLT TomDLT merged commit e500447 into scikit-learn:master Aug 2, 2018
@NicolasHug NicolasHug deleted the fix_scoring_path branch August 2, 2018 14:20
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.

3 participants
0