liveBook · Manning

Confusion matrix

As explained in Build AI Drug Discovery Pipelines

A confusion matrix is a tabulation of predicted versus actual class counts, including true positives, true negatives, false positives, and false negatives.

A confusion matrix tabulates predicted classes against true classes. Each cell counts one outcome, making classifier errors visible instead of hiding them behind accuracy—especially when class frequencies are uneven in ligand screening. section 3.3.3

For binary classification, the four cells represent:

  • True positive (TP): a positive instance predicted correctly. section 3.3.3
  • False negative (FN): a positive instance predicted as negative. section 3.3.3
  • False positive (FP): a negative instance predicted as positive. section 3.3.3
  • True negative (TN): a negative instance predicted correctly. section 3.3.3

Reading a classifier’s errors

The matrix [[119, 1], [13, 259]] records 119 true negatives, 1 false negative, 13 false positives, and 259 true positives. These counts support precision and recall, which reveal error patterns that accuracy can obscure. section 3.3.3

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Defines four binary outcomes, shows matrix interpretation, and connects counts to precision and recall; multiclass layout is noted.
Examples
Uses a scikit-learn matrix containing 119 true negatives, 1 false negative, 13 false positives, and 259 true positives.
What it assumes
Assumes binary class labels and basic classifier predictions while defining true and false outcomes explicitly.
What you can do after
Evaluate classifiers with error counts and interpret precision and recall rather than relying on accuracy alone.
How it connects
Connects classification with accuracy, precision, recall, F1 score, class imbalance, and cross-validation.

Also explained in

Compare how 16 books explain confusion matrix →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI Drug Discovery Pipelines. The section links point to the parts of the book it draws on.