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

Skip to content

DOC remove redundant example multiclass logistic regression #29966

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
Oct 22, 2024

Conversation

glemaitre
Copy link
Member

Partially addressing #27151

This PR removes one of the example of multiclass logistic regression.

In addition, it improves the example that we keep and discuss in more details the difference between one-vs-rest and multinomial logistic regression.

Copy link

github-actions bot commented Sep 29, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 782b7f0. Link to the linter CI: here

@glemaitre glemaitre changed the title Remove multiclass logistic DOC remove redundant example multiclass logistic regression Sep 29, 2024
#
# The difference in hyperplanes, especially for class 1, highlights how these methods
# can produce different decision boundaries despite similar overall accuracy. The choice
# between one-vs-rest and multinomial logistic regression can depend on the specific
Copy link
Member

Choose a reason for hiding this comment

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

I disagree. We should generally recommend the multinomial version of LogReg.
In the rare case that ovr is better in some relevant metric, it is either random (bad) luck or a bad metric.
For predicting probabilities, multinomial is the crystal clear choice.

Therefore, I would appreciate a statement at the beginning that for educational purposes we compare with ovr.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed. I was not sure how to conclude the example here.

Now that you raise this point, I changed it to emphasize that the decision planes are just arbitrary position in the OvR while I assume that you can better craft a utility function that use the probabilities estimated from the multinomial LR and thus lead optimize the real problem that you have at hand.

If you think that we should not mention it (or that I overlooked something), I'm happy to only mentioned that you should use the multinomial case.

@lorentzenchr
Copy link
Member

In general, good to merge those 2.

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

The overall multi-normal vs ovr example largely feels like an academic exportation. In practice, I would just go with multinomial.

In any case, I'm okay with merging the example and if we are keeping the multinomial vs ovr example, I think this PR improves on it.

@adrinjalali adrinjalali enabled auto-merge (squash) October 22, 2024 10:00
@adrinjalali adrinjalali merged commit 8388a1d into scikit-learn:main Oct 22, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

4 participants