MACHINE-LEARNING

Produce Image Classifier Confusion Matrix

This example evaluates an image classifier trained to identify apples, oranges and bananas. The diagonal values are the correctly classified images. Apples and oranges create more confusion with each other than either does with bananas, which can guide a review of the training images, lighting conditions or class definitions. A confusion matrix is valuable because a single overall accuracy can hide this pattern. Before drawing conclusions, check that the test set contains representative images and that no class is much smaller than the others. This is a teaching example, so it uses simple labels and a compact three-class layout.

UPDATED 2026-09-25
EXAMPLEProduce Image Classifier Confusion Matrix
Make this diagram your own.

Open it in the AI editor with a prompt pre-filled — keep what works, change what doesn't.

CASE ANALYSIS

Scenario

Students inspect how an image classifier makes class-specific errors.

Key decisions

  • Use class labels: Make mistakes understandable.
  • Read row patterns: See where each actual class goes.
  • Compare diagonal counts: Find strong and weak classes.

When to reuse this

Use for a labeled test set where every image has one class.

FAQ

Frequently asked questions

Why are rows actual classes?01
That layout shows where examples of each true class were predicted.
What can cause class confusion?02
Similar appearance, weak training data or inconsistent labels can contribute.
Is accuracy enough?03
No. The matrix reveals the distribution of errors across classes.
Open this example in the editor →

Tweak it with chat, export PNG/SVG, or fork it for your own use case.