← Selected workCase study /01
Machine learning · Python
A fraud detector designed around the cost of being wrong.
How do you detect a rare event without creating an expensive stream of false alarms?
284,807Transactions
0.17%Fraud rate
~84%F1, 5-fold CV
0.4Suggested review threshold
01 / The problem
Fraud made up less than 0.2% of the transaction data. That imbalance made overall accuracy nearly useless. The useful question was whether the model could catch fraud while keeping manual review manageable.
A model can look excellent by predicting every transaction as legitimate. I needed evaluation that reflected the cost of missed fraud and the operational cost of false positives.
02 / The approach
Build the evaluation around the decision.
- 01
Cleaned and standardized the anonymized transaction features.
- 02
Used five-fold cross-validation with F1 as the primary metric.
- 03
Trained a Random Forest and reviewed precision, recall, ROC-AUC, and the confusion matrix together.
- 04
Compared decision thresholds based on the review burden they would create.
03 / The result
~84%Mean cross-validated F1
V17 / V12 / V14Strongest model features
0.4Suggested review threshold