I'm doing 10-fold cross validation on a dataset. But in some folds there are edge cases that the denominator in precision-recall calculation is zero (tp + fp =0).

What are the correct values for precision and recall in this case? And what is the correct way of doing cross-validation (should I include these results when reporting average precision-recall over 10 folds)?

PS: This question is very similar to What are correct values for precision and recall when the denominators equal 0?

Thanks in advance : -)


1 Answer 1


Instead of using CV to estimate precision and recall, use it to obtain the expected TP, TN, FP, and FN rate. Then use those values to compute the expected precision and recall and the standard errors. (Taylor expansions come in handy for the latter.)

  • 1
    $\begingroup$ Thanks charles. Any reference or reason why this approach is better ? $\endgroup$
    – ablimit
    Apr 9, 2011 at 23:31
  • $\begingroup$ @ablimit Your problem will just likely average out =) $\endgroup$
    – user88
    Apr 11, 2011 at 11:05
  • $\begingroup$ With this approach you mean to compute TP, TN, FP and FN and then sum them out over all the cross validation folds? $\endgroup$
    – papafe
    Oct 12, 2014 at 10:04

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.