Why is accuracy a misleading metric on imbalanced datasets?

Quick Overview

Asks why accuracy can give a false picture of model quality when one class heavily outnumbers the other. Tests whether you can spot the majority-class baseline problem, account for unequal error costs, and pick evaluation metrics that reflect performance on the rare class.

Why is accuracy a misleading metric on imbalanced datasets?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

Why is accuracy a misleading metric on imbalanced datasets? ```hint Try the laziest model Take a dataset where 99% of the examples belong to one class, and work out the accuracy of a model that ignores its input and always predicts that class. ``` ### What a Strong Answer Covers - The trivial majority-class baseline and the accuracy it reaches - Why accuracy counts every error the same even when different errors have very different costs - Which metrics to use instead and what each one shows - How the decision threshold and the class ratio of the test set affect the reported numbers ### Follow-up Questions - When would ROC-AUC still be a reasonable choice on imbalanced data? - If you oversample the minority class for training, should you also rebalance the test set? Why? - How would you choose a decision threshold for a fraud model when a missed fraud costs 50 times as much as a false alarm?

Overview: Asks why accuracy can give a false picture of model quality when one class heavily outnumbers the other. Tests whether you can spot the majority-class baseline problem, account for unequal error costs, and pick evaluation metrics that reflect performance on the rare class.

General logo
General
Nov 24, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

Why is accuracy a misleading metric on imbalanced datasets?

What a Strong Answer Covers Guidance

  • The trivial majority-class baseline and the accuracy it reaches
  • Why accuracy counts every error the same even when different errors have very different costs
  • Which metrics to use instead and what each one shows
  • How the decision threshold and the class ratio of the test set affect the reported numbers

Follow-up Questions Guidance

  • When would ROC-AUC still be a reasonable choice on imbalanced data?
  • If you oversample the minority class for training, should you also rebalance the test set? Why?
  • How would you choose a decision threshold for a fraud model when a missed fraud costs 50 times as much as a false alarm?