I have a database of documents in which I perform searches. For each and every search there are n positives. Now, if I evaluate the performance of the search by precision@k and recall@k, things work out just fine for the latter:
recall@k = true positives / positives = true positives / n
The amount of true positives is in the range [0, n] so recall@k is in range [0, 1] - perfect. Things get weird concerning precision@k, however. If I calculate
precision@k = tp / (tp + fp) = tp / k
precision@k is in the range [0, n/k] which doesn't make too much sense to me. Think of the edge case n=1 for example. One cannot increase the tp beacuse there are just no more than n positives and one cannot decrease k either because, well, it's called precision@k, isn't it?
What am I getting wrong?
An example of what I'm talking about can be found in [1] figure 8b. What you can see there is a precision-recall-curve for the top 1..200 query results. Even though there are less than 200 positives in the database the precision is quite high.
[1] https://www.computer.org/csdl/pds/api/csdl/proceedings/download-article/19skfc3ZfKo/pdf