Precision and recall

Precision is the share of positive predictions that are correct: TP / (TP + FP). Recall is the share of true positives found: TP / (TP + FN). There is a trade-off between the two depending on the threshold. You favor precision when a false positive is costly, and recall when missing a positive is costly.

Example

precision_score(y_test, pred)
recall_score(y_test, pred)

Related concepts

The whole glossary