Question 128 of 1,672
F1 Score for Imbalanced Classification: Avoid Misleading Accuracy
A data scientist is training a binary classifier on an imbalanced dataset where the positive class represents 1% of the data. The model is evaluated using accuracy, but the accuracy is 99% even though the model predicts all instances as negative. Which metric should the data scientist use to properly evaluate the model?
Quick Answer
This scenario is a textbook illustration of why accuracy can be a misleading metric on imbalanced data: with only 1% of instances belonging to the positive class, a model that predicts every single instance as negative will still be right 99% of the time, achieving high accuracy while being completely useless at identifying the thing it was actually built to detect. The F1 score avoids this trap because it's the harmonic mean of precision and recall, two metrics that are both computed specifically with respect to the positive, minority, class rather than overall correctness across all instances. Recall captures how many of the actual positive cases the model successfully identifies, and precision captures how many of the model's positive predictions are actually correct, a model that predicts everything as negative would score zero on recall, which the harmonic mean punishes heavily, unlike an average that could be pulled up by unrelated strengths elsewhere. Because the harmonic mean is much more sensitive to a low value in either component than a simple average would be, F1 forces a model to perform reasonably on both precision and recall simultaneously in order to score well, which is exactly the balanced view accuracy fails to provide when one class dominates the dataset. Whenever a dataset has a heavily imbalanced target and a model shows suspiciously high accuracy alongside evidence it isn't actually distinguishing the minority class, that combination is the signal to reach for F1 score, or its component metrics, precision and recall, instead of accuracy.
⚠ Common exam trap
The trap here is that candidates see 99% accuracy and assume the model is performing well, failing to recognize that accuracy is unreliable for imbalanced datasets, and they may incorrectly choose accuracy or a regression metric without considering the need for a precision-recall based metric like F1.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
F1 score
The F1 score is the harmonic mean of precision and recall, making it robust to class imbalance. With 99% negative instances, accuracy is misleadingly high even if the model never predicts the positive class. F1 captures both false positives and false negatives, providing a balanced evaluation of the minority class performance.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Root mean squared error (RMSE)
Why it's wrong here
RMSE is for regression problems, not classification.
- ✗
Mean squared error (MSE)
Why it's wrong here
MSE is for regression problems, not classification.
- ✓
F1 score
Why this is correct
F1 score combines precision and recall, providing a better measure for imbalanced classification.
- ✗
Accuracy
Why it's wrong here
Accuracy is misleading for imbalanced datasets because a model that always predicts the majority class can achieve high accuracy.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
2 more ways this is tested on MLS-C01
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A data scientist is training a binary classifier on an imbalanced dataset where the positive class represents only 2% of the data. The model achieves 99% accuracy but only identifies 5% of actual positives. Which metric should the scientist use to evaluate the model's ability to detect the positive class?
medium- A.Accuracy
- B.F1-score
- C.Precision
- ✓ D.Recall
Why D: Recall (sensitivity) measures the proportion of actual positives correctly identified, which is the key concern here. Accuracy is misleading due to class imbalance.
Variation 2. A data scientist is training a binary classifier using logistic regression on a dataset that is highly imbalanced (95% negative class, 5% positive class). The model achieves 95% accuracy but only predicts the negative class. Which metric should the scientist use to evaluate the model's performance on the positive class?
medium- ✓ A.Recall
- B.Precision
- C.F1 Score
- D.Accuracy
Why A: The model only predicts the negative class, so recall (true positives / (true positives + false negatives)) is 0, directly revealing the failure to detect positives. Precision is undefined (or 0/0) because there are no positive predictions. Accuracy is misleading (95% but useless). Therefore, recall is the most informative metric for evaluating performance on the positive class.
Last reviewed: Jun 24, 2026
This MLS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the MLS-C01 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.