Machine Learning Community Question

How do I deal with extreme class imbalance in a fraud detection Machine Learning model?

Posted on 2025-01-05 • In Machine Learning • By Susan Montgomery

I’m building a model where only 0.1% of transactions are fraudulent. My <machine learning> classifier is 99.9% accurate just by predicting "No Fraud" every time, which is useless. Should I use oversampling, or are there specific loss functions that can force the model to care about the minority class?

3 Answers 13,082 Views

All answers to this question 3 Answers

Diane Crawford Answered on 2025-01-08
Answered

Stop looking at "Accuracy" immediately. For fraud, you need to focus on the Precision-Recall Curve and the AUPRC. Accuracy is a lie when classes are this imbalanced. I recommend using Cost-Sensitive Learning rather than simple oversampling like SMOTE. By increasing the "penalty" for missing a fraud case in your loss function, the model is forced to prioritize those rare events. In a 2023 project, we found that SMOTE often created "synthetic" data that didn't actually exist in reality, leading to high false positives. Cost-weighting kept the data real but changed the model's priorities.

Arthur Moore Answered on 2025-01-10
Answered

Have you tried using Anomaly Detection algorithms like Isolation Forest instead of a standard supervised classifier?

Howard Taylor Commented on 2025-01-11
Commented

Isolation Forest is a great alternative approach for machine learning when you don't have enough "bad" examples to train on. It works by identifying what is "abnormal" rather than trying to define what "fraud" looks like. However, if you have at least a few thousand fraud cases, a balanced Random Forest or an EasyEnsemble classifier usually performs better. These methods down-sample the majority class for each bootstrap sample, ensuring the model sees a balanced view of the world during every step of the training process.

Benjamin Lee Answered on 2025-01-12
Answered

Focus on the "Recall." It’s much more expensive to miss a fraudster than it is to manually verify a few extra "suspicious" legitimate customers.

Susan Montgomery Commented on 2025-01-13
Commented

Exactly, Benjamin. In fraud detection, the business cost of a "False Negative" is much higher than a "False Positive." Your metrics should reflect that reality.

Write a Comment

Your email address will not be published. Required fields are marked (*)

Join the LearnersEra Community

Ask questions, share knowledge and learn from professionals across technology, project management and certification topics.

Change Country and Nearest City

Select your country and nearest city to see courses available in your region.