Challenge - 5 Problems
Classification Metrics Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Metrics
intermediateCalculate accuracy from confusion matrix
Given the confusion matrix below, what is the accuracy of the classification model?
Confusion matrix:
True Positive (TP) = 40
True Negative (TN) = 50
False Positive (FP) = 10
False Negative (FN) = 5
Confusion matrix:
True Positive (TP) = 40
True Negative (TN) = 50
False Positive (FP) = 10
False Negative (FN) = 5
Attempts:
2 left
💡 Hint
Accuracy = (TP + TN) / (TP + TN + FP + FN)
✗ Incorrect
Accuracy measures the proportion of correct predictions (both true positives and true negatives) out of all predictions.
❓ Metrics
intermediateIdentify precision from classification results
A model predicted 30 true positives, 10 false positives, and 20 false negatives. What is the precision of the model?
Attempts:
2 left
💡 Hint
Precision = TP / (TP + FP)
✗ Incorrect
Precision tells us how many of the predicted positives were actually correct.
❓ Metrics
advancedCalculate recall from confusion matrix
Given the confusion matrix:
TP = 25, FP = 15, FN = 5, TN = 55
What is the recall of the model?
TP = 25, FP = 15, FN = 5, TN = 55
What is the recall of the model?
Attempts:
2 left
💡 Hint
Recall = TP / (TP + FN)
✗ Incorrect
Recall measures how many actual positives were correctly identified.
❓ Metrics
advancedCompute F1 score from precision and recall
If a model has precision = 0.8 and recall = 0.6, what is the F1 score?
Attempts:
2 left
💡 Hint
F1 = 2 * (precision * recall) / (precision + recall)
✗ Incorrect
F1 score balances precision and recall into a single metric.
🧠 Conceptual
expertChoosing the best metric for imbalanced data
You have a dataset where 95% of the samples belong to one class and 5% to the other. Which metric is most reliable to evaluate a model's performance on the minority class?
Attempts:
2 left
💡 Hint
In imbalanced data, accuracy can be misleading.
✗ Incorrect
F1 score is best because it balances precision and recall, giving a better sense of performance on the minority class.
