liveBook · Manning

Recall

As explained in Deep Learning with PyTorch, Second Edition

A classification metric measuring the fraction of actual positives that are correctly identified, which can be undefined when there are no actual positives.

A classifier can look accurate while missing every case that matters. In nodule classification, negative samples greatly outnumber positive ones, so predicting “non-nodule” for everything produces a high percentage correct but finds no nodules. Recall answers a more useful question: of the actual positive cases, how many did the classifier catch? section 14.0 section 14.3.1

Recall is true positives divided by all actual positives: true positives / (true positives + false negatives). A true positive is a nodule correctly labeled positive; a false negative is a nodule missed by the classifier. Recall is also called sensitivity. Raising recall means missing fewer positives. section 14.3.1 section 14.3.3

A guard dog that rarely misses a burglar

Imagine a guard dog that barks whenever an event might be a burglar. By setting a permissive classification threshold, it catches nearly every burglar: recall approaches 1.0. But it also barks at many harmless events. High recall alone does not mean the classifier is useful; precision tells a different part of the story. section 14.3.1 section 14.3.2

Listing 14.2 Calculating recall and precision from classification counts
recall  = metrics_dict['pr/recall'] = \
  truePos_count / np.float32(truePos_count + falseNeg_count)
precision = metrics_dict['pr/precision'] = \
  truePos_count / np.float32(truePos_count + falsePos_count)

The listing calculates recall from true-positive and false-negative counts, alongside the corresponding precision calculation. section 14.3.3

Track recall alongside precision, loss, and percentage correct each epoch. If a classifier predicts every sample as negative, its recall is zero even when overall accuracy looks excellent. If there are no actual positives, the recall formula has a zero denominator and does not yield a defined value; metric calculations need attention to such cases. F1 combines recall and precision so that a strong result on just one cannot disguise a weak result on the other. section 14.3.3 section 14.3.4 section 14.3.5

How Deep Learning with PyTorch, Second Edition covers it

How deep it goes
Defines the ratio, illustrates threshold trade-offs, and calculates it from classification counts; does not develop a general zero-denominator handling rule.
Examples
Contrasts a permissive guard-dog threshold with epoch results where an all-negative nodule classifier has zero recall.
What it assumes
Introduces true positives and false negatives before computing recall, while assuming a classifier with positive and negative labels.
What you can do after
Diagnose/debug with it when high classification accuracy hides missed positives, and track it during training alongside precision.
How it connects
Links recall to false negatives, classification thresholds, precision, and F1 score.

Also explained in

Compare how 24 books explain recall →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with PyTorch, Second Edition. The section links point to the parts of the book it draws on.