# Idea
The terms [[recall]] (and [[precision]]) comes from information retrieval theory and document retrieval systems (predate machine learning). It measures the ability of a system to "recall" all the relevant instances from a dataset: "*Of all the positive instances (that ought to be identified), how many did we correctly or manage to identify?*" (see [[confusion matrix]]).
**What proportion of actual positives was identified correctly by the model?**
Goal: We care about getting each and every positive sample correctly classified.
Recall (also known as **sensitivity** in binary classification) is defined as the following (contrast with [[precision]] and [[accuracy]]):
$\frac{true \ positive}{true \ positive + positive \ ones \ that \ were \ not \ retrieved}$
$\frac{true \ positive}{true \ positive + false \ negative}$
$\frac{true \ positive}{total \ actual \ positive}$
See [[confusion matrix]] for another way to visualize recall.
It measures **how complete or good the results** or how good the system is at retrieving all relevant documents.
It measures how many actual positives the model captures.
![[s20230523_125150 1.png|400]]
Mnemonic: **P** stands for "pie" (circle); **rec** stands for rectangle. The denominator in precision is a circle (pie); the denominator in recall is a rectangle.
Assuming we're classifying spam, it tells us the proportion of messages that were actually spam were classified by us as spam.
Recall is the complement of [[type 2 error]] rate.
Search engine query example
- search returns 30 pages; 20 are relevant
- bufailed to return 40 additional relevant pages
- precision: 20/30 = 2/3 ("how valid the results are")
- recall: 20/60 = 1/3 ("how complete the results are")
## Significance of recall
Use recall when **false negatives** are costlier or detrimental than false positives. For example, in medical diagnostics, missing a positive case (false negative) can lead to death. High recall minimizes this risk.
To balance recall and precision, use [[F1 score]] or the [[general F-beta score]].
# References
- https://en.wikipedia.org/wiki/Precision_and_recall
- [You Will Never Forget Precision and Recall If You Use the Mindset Technique](https://www.blog.dailydoseofds.com/p/you-will-never-forget-precision-and?publication_id=1119889&post_id=140686520&isFreemail=true&r=35ltar)