Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

Precision is defined as:

p = true positives / (true positives + false positives)

What is the value of precision if (true positives + false positives) = 0? Is it just undefined?

Same question for recall:

r = true positives / (true positives + false negatives)

In this case, what is the value of recall if (true positives + false negatives) = 0?

P.S. This question is very similar to the question What are correct values for precision and recall in edge cases?.

share|improve this question
Heh, it is even answered in the duplicate; but let's call it a good duplicate. – mbq Mar 8 '11 at 19:51

1 Answer

up vote 2 down vote accepted

The answers to the linked earlier question apply here too.

If (true positives + false negatives) = 0 then no positive cases in the input data, so any analysis of this case has no information, and so no conclusion about how positive cases are handled. You want N/A or something similar as the ratio result, avoiding a division by zero error

If (true positives + false positives) = 0 then all cases have been predicted to be negative: this is one end of the ROC curve. Again, you want to recognise and report this possibility while avoiding a division by zero error.

share|improve this answer
Thanks Henry for the answer. If I understand correctly, in the former case, you do not want to recognize and report the result, whereas in the latter case you do. Is that correct? – Raffi Khatchadourian Mar 8 '11 at 19:56
Yes: In the no-positives-in-input case, precision is meaningless; in the no-positives-predicted case, you want to report that the test has been set to be extremely negative. – Henry Mar 8 '11 at 22:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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