Confusion matrix

Outputs · lens

A table of right and wrong answers: one row per true class, one column per predicted class, each cell counting the examples that landed there.

Also called Error matrix, Contingency table

The real ticket router on its 272 held-out tickets. Rows: the route each ticket should get. Columns: the route the router gave. The diagonal is right; every other cell is one kind of mistake. Shading is the share of the row. Pick a cell to see which tickets are in it.
Should beRouter answered
Request infoStandardExpeditedRequest infoStandardExpedited

204 of 272 right

Should be Expedited, answered Standard: 68 tickets

Urgent · complete
68

68 that should be Expedited went to Standard. These are the urgent, complete tickets the archived edit was made for.

Figure 1. Every number is computed in your browser.

What it shows

Accuracy squeezes a whole test set into one number. A confusion matrix keeps the shape of the mistakes: the diagonal holds the examples the model got right, and every cell off the diagonal is one particular confusion, such as “should be Expedited, answered Standard”. Two models with the same accuracy can make completely different mistakes, and the matrix shows which.

How to read it

Row
The class the example really belongs to, by the labels you check against.
Column
The class the model answered.
Diagonal cell
Right answers for that class.
Off-diagonal cell
One kind of mistake, and how often it happens.
Shading
The share of the row, so rare classes are as easy to read as common ones.

What it does not tell you

It is only as right as the labels: judge the ticket router’s fix by the old rule and it shows 68 mistakes, all of them the change you wanted. It counts answers and ignores confidence, so a model that barely flipped looks the same as one that is sure. And it is a summary of one test set: a class missing from the set cannot show up as a problem.

Evaluating classifiers beyond accuracy, finding which classes a model mixes up, comparing two versions of a model on the same examples, and choosing where to collect more data.

In WeightSpace

The figure checks the real ticket router on its 272 held-out tickets. The original router sends all 68 urgent, complete tickets to Standard; the archived four-number edit puts every ticket on the diagonal; a one-number edit fixes those 68 and sends 68 routine, complete tickets to Expedited instead. WeightSpace’s workbenches show the same check as per-sample before-and-after lists rather than as a matrix.

Where to see it

No workbench draws this yet: the figure at the top of this page is the only place in WeightSpace for now.

Model structures: Support ticket router