# The Confusion Matrix

A confusion matrix sorts a classifier's guesses into four counts, true positives, false positives, false negatives and true negatives, so you can see which mistakes it makes, and scikit-learn's confusion_matrix puts the actual class in rows and the guessed class in columns, in sorted label order.

![Cheat sheet: The Confusion Matrix](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/24a93e90f48d41e6a6fecdc107af66d7.webp)

- Category: Machine Learning
- Level: Journeyman
- Tags: ai, Confusion Matrix, False Negative, False Positive, Positive Class, python, True Negative, True Positive
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/ml-confusion-matrix-cheat-sheet
