Skip to content

DOC: Add from_predictions example and other details to visualizations.rst #30825

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

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

DeaMariaLeon
Copy link
Contributor

@DeaMariaLeon DeaMariaLeon commented Feb 13, 2025

Reference Issues/PRs

Fixes #30767

What does this implement/fix? Explain your changes.

I tried to address all the points in the issue, and clarify a bit more.

Any other comments?

I moved ln 37, 38: "Be aware that we could get
the predictions from the support vector machine and then use from_predictions
instead of from_estimator." To the bottom, above the new example (written a bit differently).
I can leave it untouched if you prefer of course.

WDYT? @lucyleeow @glemaitre

Copy link

github-actions bot commented Feb 13, 2025

✔️ Linting Passed

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

Generated for commit: c9d6c0e. Link to the linter CI: here

Copy link
Member

@lucyleeow lucyleeow left a comment

Choose a reason for hiding this comment

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

The first 2 plots (that you didn't touch) do no show in the rendered doc: https://output.circle-artifacts.com/output/job/5e0cade1-0c1e-4276-9a7c-728c32f8ff27/artifacts/0/doc/visualizations.html but the new plot you add does. Is this just a CI thing where it doesn't run if it hasn't been changed...?

Looks good otherwise, just some nits

@DeaMariaLeon
Copy link
Contributor Author

DeaMariaLeon commented Feb 14, 2025

The first 2 plots (that you didn't touch) do no show in the rendered doc: https://output.circle-artifacts.com/output/job/5e0cade1-0c1e-4276-9a7c-728c32f8ff27/artifacts/0/doc/visualizations.html but the new plot you add does. Is this just a CI thing where it doesn't run if it hasn't been changed...?

I see 3 plots on the created docs. Could you clarify what you mean please? @lucyleeow

@lucyleeow
Copy link
Member

Nevermind I see 3 plots now. I guess it was just my browser? sorry!

@DeaMariaLeon
Copy link
Contributor Author

No need to be sorry.

Copy link
Contributor

@StefanieSenger StefanieSenger left a comment

Choose a reason for hiding this comment

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

I really like these changes. Thank you, @DeaMariaLeon! <3

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

A couple of thoughts regarding this doc. I think there are more tricky stuff to explain about from_predictions that are really not straightforward :)

Copy link
Member

@lucyleeow lucyleeow left a comment

Choose a reason for hiding this comment

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

Some nits and a question. Thank you!

@glemaitre glemaitre self-requested a review March 19, 2025 08:26
@glemaitre
Copy link
Member

Just a couple of comment more. @DeaMariaLeon could you resolve the comment from @lucyleeow that were addressed.

Copy link
Member

@lucyleeow lucyleeow left a comment

Choose a reason for hiding this comment

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

LGTM, just some nits.

Comment on lines 20 to 21
automatically resolve some ambiguities. For binary classification, the user must know
which column corresponds to the positive label (in this case, `y_pred`).
Copy link
Member

Choose a reason for hiding this comment

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

Not sure what your thoughts are on this @glemaitre but for decision_function, I thought we only returned one column? And we need to multiply by -1 if we wanted to switch pos_label?
I don't love the phrase "resolve some ambiguities", I would prefer something direct like, "must pass prediction values corresponding to the pos_label, for binary classification. For probabilities this means....For decision function values this means..."

Copy link
Member

Choose a reason for hiding this comment

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

Yep, we can be precise here. It should be a single sentence. What about this formulation:

For :term:`predict_proba`, the column corresponding to the probability estimate of the `pos_label` class is selected while for :term:`decision_function`, the score is reverted (i.e. multiply by -1) when `pos_label` is not the label 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lucyleeow do you agree with the last sentence from Guillaume?

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.

DOC Add from_predictions example to visualizations.rst
4 participants