Databricks Generative AI Engineer Associate Question 174
Single answerYou are working on a text classification task to categorize customer reviews into positive, neutral, or negative sentiment. During your model evaluation, you compare two models: Model A achieves an accuracy of 90% and an F1-score of 0.72, while Model B achieves an accuracy of 85% and an F1-score of 0.81. Which model should you select for deployment?
- A
Model A, because it has a higher accuracy
- B
Model B, because it has a higher F1-score
- C
Model A, because accuracy is more important than F1-score in classification tasks
- D
Model B, because F1-score considers both precision and recall, making it a better metric for imbalanced datasets
Show answer and explanation
Correct answer: D
Explanation
In tasks like text classification, especially with imbalanced datasets, accuracy can be misleading. The F1-score is a more comprehensive metric as it considers both precision and recall, providing a better measure of a model's performance on minority classes. Since Model B has a higher F1-score, it is the better choice for deployment in this scenario.
- A. Incorrect.
Accuracy alone does not account for the balance between precision and recall, which is critical in imbalanced datasets. Therefore, this option is insufficient for selecting the best model.
- B. Incorrect.
While Model B does have a higher F1-score, this option does not explain why the F1-score is more important for this task.
- C. Incorrect.
Accuracy is not always the most appropriate metric for imbalanced datasets. F1-score, which considers both precision and recall, is often more relevant for such tasks.
- D. Correct.
This is the correct answer because the F1-score provides a balanced measure of precision and recall, which is crucial for tasks with imbalanced datasets, such as sentiment analysis where one class (e.g., neutral) might dominate.