AWS Certified AI Practitioner (AIF-C01) — Question 344
A company is training ML models on datasets. The datasets contain some classes that have more examples than other classes. The company wants to measure how well the model balances detecting and labeling the classes.
Which metric should the company use?
Answer options
- A. Accuracy
- B. Recall
- C. Precision
- D. F1 score
Correct answer: D
Explanation
The F1 score is the harmonic mean of Precision and Recall, making it the ideal metric for measuring the balance between detecting and correctly labeling classes in imbalanced datasets. Accuracy is misleading for imbalanced data because a model can achieve high accuracy by simply predicting the majority class. Precision and Recall individually only measure one aspect of the model's performance rather than the balance between both.