Average Precision
A way of summarizing the PR curve that computes the weighted average of precision with respect to recall, where the weight is each increment in recall; it is often used as an approximation of PR-AUC.
Timeline (last 90 days)
In scikit-learn, Average Precision (AP) is a common way to summarize the PR curve, but it is not equivalent to directly computing the trapezoidal area under the PR curve (AUC-PR).
AP is calculated as Σ (R_n - R_{n-1}) * P_n, where P_n and R_n are the precision and recall at the nth threshold respectively, whereas the trapezoidal area under the PR curve uses linear interpolation, and the two differ when the curve is non-monotonic.
On synthetic data with 10,000 samples, a 1% positive rate, and 495 negatives scoring 0.90 while the positives score 0.80 and 0.60 respectively, computing with a 0.5 threshold gives: ROC-AUC=0.9500, Average Precision=0.1449, precision=0.1681, recall=1.0000, accuracy=0.9505, TP=100, FP=495, TN=9405, FN=0.
For a randomly ranking classifier, the expected Average Precision is approximately equal to the positive-class prevalence; at a prevalence of 1%, the random baseline AP is about 0.01.
The evaluation metric is Average Precision (AP), which is more informative than accuracy for rare-phenotype tasks with highly imbalanced samples.
All Facts (5)
In scikit-learn, Average Precision (AP) is a common way to summarize the PR curve, but it is not equivalent to directly computing the trapezoidal area under the PR curve (AUC-PR).
50%UnverifiedAP is calculated as Σ (R_n - R_{n-1}) * P_n, where P_n and R_n are the precision and recall at the nth threshold respectively, whereas the trapezoidal area under the PR curve uses linear interpolation, and the two differ when the curve is non-monotonic.
50%UnverifiedOn synthetic data with 10,000 samples, a 1% positive rate, and 495 negatives scoring 0.90 while the positives score 0.80 and 0.60 respectively, computing with a 0.5 threshold gives: ROC-AUC=0.9500, Average Precision=0.1449, precision=0.1681, recall=1.0000, accuracy=0.9505, TP=100, FP=495, TN=9405, FN=0.
50%UnverifiedFor a randomly ranking classifier, the expected Average Precision is approximately equal to the positive-class prevalence; at a prevalence of 1%, the random baseline AP is about 0.01.
50%UnverifiedThe evaluation metric is Average Precision (AP), which is more informative than accuracy for rare-phenotype tasks with highly imbalanced samples.
50%