Precision

machine-learning
Precision

For some binary classification problem where we are using $\hat{f}: A \rightarrow \{1, -1\}$ to predict $f: A \rightarrow \{1, -1\}$ for some testing data $T$ we define

$$\mbox{Precision}(\hat{f}, T) = \frac{\vert \{ t \in T \vert f(t) = \hat{f}(t) = 1\} \vert}{\vert \{ t \in T \vert \hat{f}(t) = 1\} \vert} $$

in terms result types this is

$$\mbox{Precision}(\hat{f}, T) = \frac{\mbox{True positives}}{\mbox{True positives} + \mbox{False positives}}.$$