FIX compute precision-recall at 100% recall#23214
FIX compute precision-recall at 100% recall#23214jeremiedbb merged 11 commits intoscikit-learn:mainfrom
Conversation
|
You will need to fix failing tests. Basically, it should be docstring test in most cases. |
|
@glemaitre I added 3 commits:
|
|
Please add an entry to the change log at |
| ... y_true, y_scores) | ||
| >>> precision | ||
| array([0.66666667, 0.5 , 1. , 1. ]) | ||
| array([0.5 , 0.66666667, 0.5 , 1. , 1. ]) |
There was a problem hiding this comment.
We should update the docstring of thresholds to define properly n_thresholds.
glemaitre
left a comment
There was a problem hiding this comment.
Apart from these 2 changes, LGTM
glemaitre
left a comment
There was a problem hiding this comment.
Thanks for the changes. LGTM
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
|
It seems the doc is failing, but I cannot understand why: nothing wrong at line 105. |
|
For sure this is not linked with your change. We can ignore it. |
|
I merge |
jeremiedbb
left a comment
There was a problem hiding this comment.
LGTM. Thanks @stephanecollot
|
It went very smoothly, I'm happy I did this first contribution, thank you @glemaitre. |
|
@stephanecollot I started a POC on the subject: #21211 The idea is to use cross-validation to get uncertainty bounds. I will probably find time to carry on some work in the next release. However, we will need to breakdown the PR into smaller PR to facilitate the review process:
|
Co-authored-by: Guillaume Lemaitre <[email protected]> Co-authored-by: jeremiedbb <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]> Co-authored-by: jeremiedbb <[email protected]>
Reference Issues/PRs
Fixes #23213
What does this implement/fix? Explain your changes.
Remove the unnecessary dropping.
Any other comments?
Full disclosure, this PR modifies
precision_recall_curve()that is only used by_binary_uninterpolated_average_precision()that is only used byaverage_precision_score()scikit-learn/sklearn/metrics/_ranking.py
Line 205 in 24106c2
I think average_precision_score() should not be impacted by this change, and its is tested 54 times in unit tests