Is it possible to have a Precision-Recall curve like this if your recall is zero and your precision is not defined? How do I interpret this?

AUC-PR example

I have checked that all the scores are right and I still don't understand the appearance of the curve.


1 Answer 1


The recall is 1 when the system predicts every instance as positive, 0 if it predicts every instance as negative. But if all the instances are predicted as negative then precision is undefined (division by zero: there's no TP nor FP). I assume that the undefined value is replaced with zero on the curve in order to make it look continuous.

Technically the only way to have zero for both precision and recall is this:

  • zero TP
  • at least one FP (otherwise precision is undefined)
  • at least one FN (otherwise recall is undefined)

This would mean that the system always predicts gold positive instances as negative and gold negative instances as positive. Therefore the system can be improved... just by switching the predicted labels :)

  • $\begingroup$ yes, my mistake, you are right. The precision is not zero, is undefined, so maybe the curve appearance is like that because of this reason. $\endgroup$
    – Valderas
    Dec 2, 2021 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.