A confusion matrix is a table that shows the performance of a classification model by comparing actual labels with predicted labels. It helps us see how many predictions were correct or wrong for each class.
Click to reveal answer
beginner
What do the terms True Positive (TP), False Positive (FP), True Negative (TN), and False Negative (FN) mean in a confusion matrix?
TP: Model correctly predicted positive. FP: Model predicted positive but it was negative. TN: Model correctly predicted negative. FN: Model predicted negative but it was positive.
Click to reveal answer
intermediate
How can a confusion matrix help in understanding model errors?
It shows exactly where the model makes mistakes by counting wrong predictions for each class. This helps us know if the model confuses certain classes more than others.
Click to reveal answer
intermediate
What is the difference between accuracy and precision using confusion matrix terms?
Accuracy = (TP + TN) / Total predictions, shows overall correctness. Precision = TP / (TP + FP), shows how many predicted positives are actually positive.
Click to reveal answer
advanced
Why is a confusion matrix especially useful for imbalanced datasets?
Because accuracy can be misleading when classes are imbalanced, the confusion matrix shows detailed counts of each type of error, helping us understand model performance on minority classes.
Click to reveal answer
What does the cell in the confusion matrix representing False Negative (FN) indicate?
AModel predicted negative but actual was positive
BModel predicted negative and actual was negative
CModel predicted positive and actual was positive
DModel predicted positive but actual was negative
✗ Incorrect
False Negative means the model missed a positive case by predicting it as negative.
Which metric can be directly calculated from a confusion matrix?
ALearning rate
BAccuracy
CNumber of features
DEpoch count
✗ Incorrect
Accuracy is calculated as (TP + TN) divided by total predictions, all values found in the confusion matrix.
If a confusion matrix has high False Positives, what does it mean?
AModel predicts all cases correctly
BModel often misses positive cases
CModel often wrongly predicts positive when it is negative
DModel has no errors
✗ Incorrect
High False Positives means the model wrongly labels negative cases as positive.
Why might accuracy be misleading on imbalanced datasets?
ABecause it ignores the number of features
BBecause it only counts True Positives
CBecause it depends on the learning rate
DBecause it can be high even if the model ignores minority class
✗ Incorrect
Accuracy can be high if the model predicts the majority class well but fails on minority classes, hiding poor performance.
Which of these is NOT part of a confusion matrix?
ALearning Rate
BTrue Positive
CFalse Negative
DTrue Negative
✗ Incorrect
Learning rate is a training parameter, not part of the confusion matrix.
Explain what a confusion matrix is and how it helps evaluate a classification model.
Think about how a table can show correct and wrong predictions.
You got /4 concepts.
Describe the four parts of a confusion matrix and what each part means.
Consider what happens when the model guesses right or wrong for positive and negative cases.
You got /5 concepts.
Practice
(1/5)
1.
What does a confusion matrix primarily show in machine learning?
easy
A. The number of correct and incorrect predictions for each class
B. The speed of the model training process
C. The size of the dataset used for training
D. The number of features in the dataset
Solution
Step 1: Understand the purpose of a confusion matrix
A confusion matrix shows how many times a model predicted each class correctly or incorrectly.
Step 2: Identify what it displays
It displays counts of true positives, true negatives, false positives, and false negatives for each class.
Final Answer:
The number of correct and incorrect predictions for each class -> Option A
Quick Check:
Confusion matrix = correct and incorrect counts [OK]
Hint: Confusion matrix counts correct and wrong guesses per class [OK]
Common Mistakes:
Thinking it shows training speed
Confusing it with dataset size
Assuming it shows feature count
2.
Which of the following is the correct way to represent a confusion matrix for a binary classifier?
[[TP, FP],
[FN, TN]]
easy
A. true Positives, false Positives in first row; false Negatives, true Negatives in second row
B. true Negatives, false Negatives in first row; false Positives, true Positives in second row
C. false Positives, true Positives in first row; true Negatives, false Negatives in second row
D. false Negatives, true Negatives in first row; true Positives, false Positives in second row
Solution
Step 1: Recall confusion matrix layout for binary classification
The standard layout is: first row has true Positives (TP) and false Positives (FP), second row has false Negatives (FN) and true Negatives (TN).
Step 2: Match the given matrix to the layout
The given matrix [[TP, FP], [FN, TN]] matches the standard layout exactly.
Final Answer:
true Positives, false Positives in first row; false Negatives, true Negatives in second row -> Option A