Confusion Matrix Playground

Two interactive tools for building intuition about classification metrics.

These widgets accompany the article Precision, Recall, F1 score, and More | The Ultimate Guide to Confusion Matrix and Classification Metrics, which explains every metric shown here and where each one came from.

1. Metric Calculator

Type any four counts, or load a preset, and every metric in the confusion-matrix family updates live. Each metric shows its formula, grouped by whether it reads a row, a column, or the whole table.

Try this: load Accuracy paradox (99:1) and watch accuracy stay above 99% while recall drops to zero and MCC collapses to 0.000 — a model that looks excellent and catches nothing. Then compare Plagiarism (high precision) against Cancer (high recall): same F1 of 0.900, mirror-image priorities.

Confusion Matrix Metric Calculator

Type the four counts (or load a preset). Every metric updates live.

Predicted
PositiveNegative
Actual Positive
Negative

2. The 100-Ball Playground

The calculator takes the four counts as given; this playground lets you build them by hand. Each ball’s colour is the truth (blue = actually positive, grey = actually negative) and the bin it sits in is the model’s prediction. Drag any ball across to reclassify it and watch the metrics move.

Three things worth trying: (1) hit Predict all positive to build a classifier with perfect recall and useless precision; (2) drag every blue ball into the right-hand bin to recreate the always-negative model from the accuracy paradox; (3) start from Random (Random) and try to raise MCC above 0.5 by hand.

100-Ball Classification Playground

Color is the truth; the bin is the prediction. Drag a ball to reclassify it.

Actually positive (is plagiarism / has cancer) Actually negative
Predicted positive
Predicted negative