You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's really amazing!! Why are the calculation results of the AUC (recall, precision) function and the average precision score function significantly different?
#29051
Closed
kourenke opened this issue
May 20, 2024
· 2 comments
Method 1:
Precision, recall, _=Precision-Recall_curve()
A=auc (recall, precision)
Method 2:
B=average precision score ()
Method 1 and Method 2 both calculate the area under the PR curve, but why are the results significantly different, i.e. a ≠ b
Steps/Code to Reproduce
Method 1:
Precision, recall, _=Precision-Recall_curve()
A=auc (recall, precision)
Method 2:
B=average precision score ()
Method 1 and Method 2 both calculate the area under the PR curve, but why are the results significantly different, i.e. A ≠ B
Expected Results
A = B
Actual Results
A ≠ B
Versions
sklearn: 1.0.2
The text was updated successfully, but these errors were encountered:
The average precision (cf. average_precision_score) in scikit-learn is computed without any interpolation. To be consistent with this metric, the precision-recall curve is plotted without any interpolation as well (step-wise style).
You can change this style by passing the keyword argument drawstyle="default". However, the curve will not be strictly consistent with the reported average precision.
The computation of average precision is therefore not trivial :)
Describe the bug
Method 1:
Precision, recall, _=Precision-Recall_curve()
A=auc (recall, precision)
Method 2:
B=average precision score ()
Method 1 and Method 2 both calculate the area under the PR curve, but why are the results significantly different, i.e. a ≠ b
Steps/Code to Reproduce
Method 1:
Precision, recall, _=Precision-Recall_curve()
A=auc (recall, precision)
Method 2:
B=average precision score ()
Method 1 and Method 2 both calculate the area under the PR curve, but why are the results significantly different, i.e. A ≠ B
Expected Results
A = B
Actual Results
A ≠ B
Versions
The text was updated successfully, but these errors were encountered: