Classification
PR AUC (average precision)
Implemented
classification.pr_aucDefinition
Summary of the precision-recall curve, computed as average precision over recall steps.
Formula
AP = Σₙ (Rₙ − Rₙ₋₁) · Pₙ
Range: [0, 1]
Inputs and outputs
- y_true: array of binary labels {0, 1}
- y_prob: predicted probability of the positive class in [0, 1]
Returns: float
Assumptions
No assumptions beyond valid, aligned inputs of the documented types.
Limitations
- The baseline equals prevalence, so values are not comparable across datasets with different prevalence.
- Trapezoidal interpolation of PR curves is optimistic; average precision avoids it.
Python API
import evalsuite as es
es.average_precision(y_true, y_prob)References
- Davis, J., & Goadrich, M. (2006). The relationship between precision-recall and ROC curves. Proceedings of the 23rd International Conference on Machine Learning, 233–240.
- Saito, T., & Rehmsmeier, M. (2015). The precision-recall plot is more informative than the ROC plot when evaluating binary classifiers on imbalanced datasets. PLOS ONE, 10(3), e0118432.