You are training a machine learning model to detect credit card fraud. After the first run, the model achieves a stellar 99.8% classification accuracy on your test dataset. However, upon reviewing the dataset labels, you find that 99.8% of the transactions are actually legitimate (non-fraudulent). Why is relying solely on accuracy as your primary evaluation metric a dangerous choice in this scenario?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal: accuracy is the ultimate trap for beginners in machine learning. Imagine you're running a security checkpoint at an airport, and 99.8% of the people walking through are good citizens. If your security guard just sits there, drinks coffee, and says 'you're good to go' to every single person without looking, they're technically 99.8% accurate! But they completely failed at their actual job—catching the bad guys. That's exactly what happens when you train a classification model on highly imbalanced data. A lazy model can just guess the majority class every single time, look like a genius with 99.8% accuracy, and yet fail to catch a single fraud transaction. Trust me, in the real world, you'll want to dump accuracy and look at metrics like Precision, Recall, or F1-score to see how well you're actually doing with that minority class. Got it? Sweet. Let's keep rolling.
Full explanation below image
Full Explanation
In machine learning, model evaluation metrics must be chosen carefully based on the characteristics of the dataset. When dealing with highly imbalanced datasets—where one class (the majority class) vastly outnumbers the other (the minority class)—classification accuracy becomes a highly misleading performance metric. Accuracy is mathematically defined as the number of correct predictions divided by the total number of predictions. If 99.8% of the dataset belongs to a single class, a naive classifier that simply outputs the majority class for every input will achieve 99.8% accuracy. However, such a model has learned no predictive patterns and possesses zero utility for identifying the critical minority class (e.g., detecting fraud, diagnosing rare diseases, or predicting equipment failures). To properly assess a model's performance on imbalanced data, practitioners rely on other evaluation metrics: Precision (the ratio of true positives to predicted positives), Recall (the ratio of true positives to actual positives), and the F1-Score (the harmonic mean of precision and recall). The other choices represent common misconceptions: underfitting or overfitting does not directly explain why a high accuracy metric is inherently misleading on unbalanced data, and dataset size or gradient behavior is not the root cause of the accuracy paradox.