Suppose 10 documents were retrieved (rectangle with black color is relevant document). In the following table, Precision @ k is calculated. P@10 or "Precision at 10" corresponds to the number of relevant results among the top 10 documents.
| rank(K)| Precision@K | | ------ | ------------- | | 1 | (1/1) = 1.0 | | 2 | (1/2) = 0.5 | | 3 | (2/3) = 0.67 | | 4 | (3/4) = 0.75 | | 5 | (4/5) = 0.80 | | 6 | (5/6) = 0.83 | | 7 | (6/7) = 0.86 | | 8 | (6/8) = 0.75 | | 9 | (7/9) = 0.78 | | 10 | (7/10) = 0.70 |
The more relevant documents are at the front, the more influence it has and earn more points. So then we have greater Precision@k. So, if we swap ranks 8 and 9 we get the following results:
| rank(K)| Precision@K | | ------ | ------------- | | 1 | (1/1) = 1.0 | | 2 | (1/2) = 0.5 | | 3 | (2/3) = 0.67 | | 4 | (3/4) = 0.75 | | 5 | (4/5) = 0.80 | | 6 | (5/6) = 0.83 | | 7 | (6/7) = 0.86 | | 8 | (7/8) = 0.875 | | 9 | (7/9) = 0.78 | | 10 | (7/10) = 0.70 |
Wikipedia says: Precision at k documents (P@k) is still a useful metric (e.g., P@10 or "Precision at 10" corresponds to the number of relevant results among the top 10 documents), but fails to take into account the positions of the relevant documents among the top k.
Unfortunately I don't get the last sentence. How does it mean here? We could even see that changing the position changes the precision @ k.