Databricks Generative AI Engineer Associate Question 173
Single answerYou are tasked with selecting the best model for a text classification task in a Databricks ML experiment. The following models were trained and evaluated:
- Model A: Accuracy = 85%, F1 Score = 0.82, Precision = 0.84, Recall = 0.80
- Model B: Accuracy = 83%, F1 Score = 0.85, Precision = 0.86, Recall = 0.84
- Model C: Accuracy = 86%, F1 Score = 0.81, Precision = 0.83, Recall = 0.79
Given that the dataset is imbalanced, which model would you select, and why?
- A
Model A, because it has the highest accuracy.
- B
Model B, because it has the highest F1 Score.
- C
Model C, because it has the highest accuracy and is therefore the most reliable.
- D
Model A, because it has the highest precision.
Show answer and explanation
Correct answer: B
Explanation
In imbalanced datasets, accuracy can be misleading because it does not account for the distribution of classes. F1 Score, which is the harmonic mean of precision and recall, is a more suitable metric for evaluating models in such scenarios. Model B has the highest F1 Score, making it the best choice for this task.
- A. Incorrect.
Model A has the highest accuracy compared to Model B, but accuracy is not the most reliable metric for imbalanced datasets. Metrics like F1 Score are better suited for such scenarios.
- B. Correct.
Model B has the highest F1 Score, which is a balanced metric considering both precision and recall. This makes it the best choice for imbalanced datasets, where both false positives and false negatives matter.
- C. Incorrect.
Although Model C has the highest accuracy, it has the lowest F1 Score. Accuracy alone is not a good indicator of performance in imbalanced datasets.
- D. Incorrect.
While Model A has the highest precision, focusing solely on precision ignores recall, which is critical in imbalanced datasets. F1 Score provides a better overall measure.