Class Imbalance
ELI5 - The Vibe Check
Class imbalance is when your fraud detector trains on data where 99.9% of transactions are totally normal, so it can hit 99.9% accuracy by doing the laziest possible thing: always guessing not fraud and never actually learning what fraud looks like. High accuracy on an imbalanced dataset can mean your model learned nothing at all.
Real Talk
Class imbalance occurs when the classes in a classification dataset are represented unevenly, such that a naive model predicting only the majority class achieves deceptively high accuracy while providing zero practical value. It's addressed through resampling techniques, such as oversampling the minority class or undersampling the majority, class weighting, or by evaluating with metrics like precision, recall, and AUC instead of raw accuracy.
When You'll Hear This
"Accuracy is meaningless here, we've got 500 fraud cases out of 2 million transactions, that's serious class imbalance." / "We oversampled the minority class with SMOTE before training to deal with the class imbalance."
Related Terms
Confusion Matrix
A confusion matrix is a little table that stops your model from lying to you with a single accuracy number.
Data Leakage
Data leakage is when your model accidentally gets to peek at the answer key before the test.
Precision
Precision asks: 'Of all the times the AI said YES, how often was it actually right?
Recall
Recall asks: 'Of all the actual YES cases in the world, how many did the AI catch?' High recall means the model finds almost everything it should.
ROC AUC
A ROC curve is what happens when you slide your model's how-sure-do-I-need-to-be-before-I-say-yes dial from paranoid to reckless and plot what happens to i...