What is Confusion Matrix?
A confusion matrix is a table that compares a classifier's predictions with the actual classes. For two classes, it shows true positives, false positives, true negatives and false negatives. From this, metrics such as precision, recall and F1 score can be calculated, and it becomes clear which errors occur. Example: a spam filter that flags many genuine emails as spam has many false positives, which is often more costly than a missed spam message.