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
{{ message }}
Repository navigation
Bugs in metrics.ranking.precision_recall_curve #5073
I found this problem because one of my baseline model had a AUC score much higher then my expectation.
The baseline model returned a result similar to my example above. The tie in the first threshold is the root cause.
My suggestion is use the point (0, precision of the first threshold) as the most left end. (0,1) will over-estimate the AUC, while (0, 0) will under-estimate it.
The current metrics.precision_recall_curve returns a curve with AUC = 0.5167, and the method based on my suggestion will return:
Yeah, but taking average score of the first threshold should be a reasonable solution, since it's an expected value of y axis. If n is large and points are randomly ordered, the curve will be really close to the expected line.
Activity
agramfort commentedon Aug 1, 2015
adamzjw commentedon Aug 1, 2015
I found this problem because one of my baseline model had a AUC score much higher then my expectation.
The baseline model returned a result similar to my example above. The tie in the first threshold is the root cause.
My suggestion is use the point (0, precision of the first threshold) as the most left end. (0,1) will over-estimate the AUC, while (0, 0) will under-estimate it.
The current metrics.precision_recall_curve returns a curve with AUC = 0.5167, and the method based on my suggestion will return:
p_fix = [0.4, 0.33333333, 0.3333333]
recall = [ 1. 0.5 0. ]
AUC = 0.3498
agramfort commentedon Aug 4, 2015
adamzjw commentedon Aug 6, 2015
R has several packages to plot PR curve.
According to the 7th page of the doc of PRROC (https://cran.r-project.org/web/packages/PRROC/vignettes/PRROC.pdf), the PR curve starts from neither (0,0) or (0,1).
The source code is like a mess, I'm not really understanding what they are doing there. But looks like they compute the curve point by point.
agramfort commentedon Aug 8, 2015
adamzjw commentedon Aug 11, 2015
Yeah, but taking average score of the first threshold should be a reasonable solution, since it's an expected value of y axis. If n is large and points are randomly ordered, the curve will be really close to the expected line.
jnothman commentedon Aug 15, 2015
I assume this is a duplicate of #4223 (and no doubt others!)
adamzjw commentedon Aug 16, 2015
Yeah, exactly.
jnothman commentedon Aug 17, 2015
Closing as duplicate.