We use the mean average precision (mAP) to measure the accuracy of information retrieval models.
The mAP is a value between
We describe it by the following formula:
In the above formula,
To understand the calculation of mAP, we must first explore precision, precision at
Precision is the ratio of correctly-identified
We must slightly modify the formula for precision to use it with an information retrieval model, as follows:
The
The
The intersection size of
Usually, precision takes all the retrieved documents into account. However, another way to calculate precision involves a
To understand
Average precision is the area under the precision-recall curve. For information retrieval models, where recall is a less critical metric, we can calculate AP using the following formula:
Where
Let's continue with the previous example. We can calculate the AP of the information retrieval model as follows:
Let's consider another model that assigns the highest scores to the relevant documents.
As we can see, more accurate models—those that assign higher scores to the relevant documents—have greater average precision.
We repeat the calculation for AP for each query. The mAP across this set of queries is the average of the calculated APs.