01Chapter 1: Predicted labels versus actual labelsA confusion matrix starts from one idea: every prediction a classifier makes can be compared with the true answer. This chapter sets up that comparison. Later chapters build the four outcomes, the matrix layout and the metrics on top of it.3 min read
02Chapter 2: The four outcomes: TP, FP, FN, TNThis chapter assumes you know what supervised binary classification is, can read short Python snippets, and are comfortable with counts and ratios. It covers the four outcome types that every later metric is built from.3 min read
03Chapter 3: Laying out the matrix and checking its axesThis chapter assumes you know what a binary classifier is and can read short Python snippets. It also assumes you know the four outcomes (TP, FP, FN, TN) from the previous chapter. Here you will learn where each outcome sits in the grid and how to confirm which axis is which before you read any numb2 min read
04Chapter 4: Accuracy: the share of correct predictionsThis chapter assumes you know what a confusion matrix looks like and can name its four cells (TP, FP, FN, TN). It also assumes you can read short Python snippets.3 min read
05Chapter 5: Precision: how trustworthy a positive prediction isThis chapter assumes you can read a binary confusion matrix and name its four cells (TP, FP, FN, TN). It also assumes you are comfortable with ratios and short Python snippets. Here you will learn what precision measures, how to compute it, and where it goes wrong.2 min read
06Chapter 6: Recall: how many real positives were foundThis chapter assumes you know the four outcomes (TP, FP, FN, TN) and that scikit-learn puts actual labels on the rows and predicted labels on the columns. Both are covered in earlier chapters.2 min read
07Chapter 7: Why accuracy misleads on imbalanced dataThis chapter assumes you can read a binary confusion matrix and name its four cells (TP, FP, FN, TN). It also assumes you know the definitions of accuracy and recall from the earlier chapters.2 min read
08Chapter 8: F1: combining precision and recallThis chapter assumes you can read a binary confusion matrix and compute precision and recall from the TP, FP and FN counts. It also assumes you can read short Python snippets.2 min read
09Chapter 9: Specificity and false positive rateThis chapter assumes you can already find TP, FP, FN and TN in a binary confusion matrix. It also assumes you know recall and can read short Python snippets. Recall measures how well a model finds the positives. Specificity measures the same thing for the negatives.2 min read
10Chapter 10: How the decision threshold reshapes the matrixThis chapter assumes you can read a binary confusion matrix (TN, FP, FN, TP), know precision, recall and specificity, and can follow short Python snippets. Many classifiers don't output a label directly. They output a score, and the threshold turns that score into a label. Changing the threshold cha2 min read
11Chapter 11: Axis conventions in scikit-learn and other toolsThis chapter assumes you can compute precision and recall from the four cell counts (TP, FP, FN, TN) and can read short Python snippets. The counts are the same in every tool. What changes is where each tool puts them, and a transposed matrix swaps precision and recall without any error message.3 min read
12Chapter 12: Normalizing by row, column or totalThis chapter assumes you can read a raw confusion matrix and know that scikit-learn puts actual labels on the rows and predicted labels on the columns. You should also know precision and recall.2 min read
13Chapter 13: Reading a multiclass matrixThis chapter assumes you can read a binary confusion matrix and compute precision and recall from TP, FP, FN and TN. It also assumes you know that scikit-learn puts actual labels on rows and predicted labels on columns. The Python snippets are short.2 min read
14Chapter 14: Macro, micro and weighted averagesThis chapter assumes you can read a multiclass confusion matrix and compute precision, recall and F1 for one class. Those are the per-class metrics from the earlier chapters.2 min read