# Precision and Recall
## Precision
Precision measures how accurate is your predictions. i.e. the percentage of your predictions are correct.
$
\text { Precision }=\frac{T P}{T P+F P}
$
or simply, **Precision = TP / predicted positives** i.e. out of our predicted positives how many did we get right.
## Recall
Recall measures how good you find all the positives. For example, we can find 80% of the possible positive cases in our top K predictions.
$
\text { Recall }=\frac{T P}{T P+F N}
$
or simply, **Recall = TP / all positives** i.e. out of all positives how many did we catch.
## Average Precision
AP = Average of precisions at relevant documents
It can also be obtained from the AUC of [[Classification Metrics and Evaluation#PR curve]].
$
\begin{aligned}
&\begin{array}{cccc}
\text { Rank } & \text { Rel. } & \text { Precision } & \text { Recall } \\
1 & \mathrm{R} & 1 / 1 & 1 / 10 \\
2 & \mathrm{~N} & 1 / 2 & 1 / 10 \\
3 & \mathrm{R} & 2 / 3 & 2 / 10 \\
4 & \mathrm{R} & 3 / 4 & 3 / 10 \\
5 & \mathrm{~N} & \ldots & \ldots \\
6 & \mathrm{R} & 4 / 6 & 4 / 10 \\
7 & \mathrm{~N} & & \\
8 & \mathrm{~N} & \cdots & \ldots \\
9 & \mathrm{~N} & & \\
10 & \mathrm{R} & 5 / 10 & 5 / 10 \\
\ldots & \ldots & \ldots & \ldots \\
\infty & \mathrm{R} & 0 & 10 / 10
\end{array}\\
&A P=\frac{\frac{1}{1}+\frac{2}{3}+\frac{3}{4}+\frac{4}{6}+\frac{5}{10}+\ldots}{10}
\end{aligned}
$
---
## References