Solution (source code)

= Solution

The two quantities are
$$
\boxed{\mathrm{precision}=\frac{TP}{TP+FP},\qquad\mathrm{recall}=\frac{TP}{TP+FN}.}
$$
<Classification precision> asks how many retained calls agree with the positive reference; <classification recall> asks how much of the positive reference set has been recovered. Recall is the <true positive rate>. Increasing recall by accepting more loci can reduce precision through additional false positives.

If positive prevalence is $p$, then
$$
\mathrm{precision}=\frac{p\,\operatorname{TPR}}{p\,\operatorname{TPR}+(1-p)\operatorname{FPR}}.
$$
Thus prevalence matters: good ROC discrimination need not give high precision when true positives are rare. A precision–recall area must be judged against its own prevalence-dependent baseline; it is not numerically interchangeable with ROC area.