I am building an algorithm that attempts to return relevant documents. If the query retrieves 10 documents but none are relevant how is the average precision calculated? Applying the AveP formula, it becomes an issue because it is divide by zero since the denominator is number of relevant documents.
1 Answer
The precision does not make sense if you have not retrieved any documents. If you need a value for the precision it should be null
, or whatever you would like to use to indicate a missing value.
-
$\begingroup$ Documents are retrieved, but none are relevant. Does that clarify? $\endgroup$– KevinJul 11, 2018 at 16:18