What is Confusion matrix?
In Turkish: Karışıklık matrisi · Topic: Data and evaluation
A table that compares a classification model's predictions with the true labels and shows, in rows and columns, which classes the model mixes up with which.
How does it work?
In binary classification the table has four cells: true positive, false positive, false negative, and true negative. Rows usually show the actual class and columns the model's prediction, though this layout varies by source. Each test example is counted in a cell according to its true and predicted labels. With more than two classes the table grows, and the off-diagonal cells reveal which classes get confused with each other. Accuracy, precision, recall, and F1 are all derived from these counts.
Why does it matter?
A single success percentage does not say where a model goes wrong. A confusion matrix makes the type and distribution of errors visible, so it becomes clear whether a disease-screening model misses sick patients or wrongly flags healthy ones. It helps decide what to improve first when developing a model.
Example
In a model that classifies cats, dogs, and rabbits, if the matrix shows dogs often being labeled as cats, the team might decide to collect more training data for those two classes.
FAQ
What do true positive and false positive mean?
A true positive is an example the model called positive that really is positive. A false positive is an example the model called positive that is actually negative, in other words a false alarm.
Do the rows or the columns show the true class in a confusion matrix?
It is a convention and varies between sources. In many, rows show the actual class and columns the prediction, so it is worth checking the axis labels before reading the table.