liveBook · Manning

False positive

As explained in Deep Learning with PyTorch, Second Edition

Negative cases that a classifier incorrectly predicts as positive, increasing the apparent success on the positive class but hurting utility.

A false positive occurs when a classifier predicts the desired class for something that is actually negative. A nodule detector creates one by flagging an uninteresting candidate for radiologist review; a guard dog creates one by barking at a cat, thunderstorm, or mail carrier. False positives waste attention and can make an apparently successful model impractical. section 14.2

False positives become especially important when evaluating classifiers:

  • Precision improves when false positives decrease: it measures true positives among everything predicted positive. section 14.3.2
  • A classification threshold can trade false positives against false negatives: a cautious threshold rejects more negative cases, while an inclusive threshold catches more positives but raises false alarms. section 14.3.2 section 14.3.1
  • Class imbalance can make a small negative-case error produce many false positives relative to the positive cases, despite high overall accuracy. section 14.4.2

A misleadingly accurate nodule detector

Suppose validation contains 54,971 negative samples and 136 positive samples. Misclassifying only 1% of the negative samples creates about 550 false positives—roughly four times the number of actual positives. A balanced training run reports 98.4% negative accuracy but only 0.1102 precision, showing why accuracy alone can hide poor practical utility. section 14.4.2

Listing 14.1 Computing counts for true/false positives and negatives
neg_count = int(negLabel_mask.sum())
pos_count = int(posLabel_mask.sum())

trueNeg_count = neg_correct = int((negLabel_mask & negPred_mask).sum())
truePos_count = pos_correct = int((posLabel_mask & posPred_mask).sum())

falseNeg_count = pos_count - pos_correct
falsePos_count = neg_count - neg_correct

The count calculation makes false positives concrete: subtract correctly classified negative samples from all negative samples. section 14.3.3

How Deep Learning with PyTorch, Second Edition covers it

How deep it goes
Defines the error, relates it to precision and thresholds, calculates it from counts, and stops short of broader metric theory.
Examples
Uses guard dogs, cats, nodule candidates, validation counts, and training logs to illustrate false-positive behavior.
What it assumes
Assumes binary positive and negative labels while defining true positives, false positives, and related counts accessibly.
What you can do after
Diagnose false-alarm problems by counting misclassified negatives and comparing precision with accuracy and recall.
How it connects
Connects false positives with precision, recall, false negatives, true positives, classification thresholds, and class imbalance.

Also explained in

Compare how 19 books explain false positive →

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.