Fraud Transaction Detection
Pythonscikit-learnpandasNumPySciPy
An end-to-end fraud-detection model on 6.4M financial transactions that catches 95% of fraud at 0.995 ROC-AUC — built around a leak-free, reusable preprocessing pipeline and evaluation tuned for catching rare cases rather than raw accuracy.
Results
- Built an end-to-end fraud-detection model on 6.4M financial transactions, catching 95% of fraud at 0.995 ROC-AUC despite a 0.13% fraud rate.
- Trained a class-weight-balanced Logistic Regression on a 0.13% fraud rate, reaching 95.31% fraud recall and 96.78% accuracy without resampling.
- Pruned seven weak predictors through coefficient analysis, shrinking the feature set while holding ROC-AUC at 0.9946 versus the full 0.995.
Feature engineering & pipeline
- Designed a reusable feature pipeline that cleans and engineers 6.4M-row transaction data into model-ready inputs for fraud scoring.
- Engineered a custom scikit-learn transformer (BaseEstimator/TransformerMixin) bundling encoding, scaling, and feature creation into one fit/transform step reusable on new data.
- Created domain fraud features — balance deltas, a suspicious-transfer flag, log-scaled amount, and cyclical time encodings — that ranked as the model's top predictors.
Data cleaning & validation
- Cleaned 6.4M records by dropping leakage columns and one of two perfectly correlated balance fields, removing multicollinearity before modeling.
- Validated feature significance with Chi-Square and Mann-Whitney U tests, confirming transaction type and amount differ across fraud classes at p < 0.0001.
- Surfaced that fraud concentrates in high-value CASH_OUT/TRANSFER transfers (avg 1.47M vs 178K), pinpointing balance-unchanged transfers as a core fraud signal.
← Back to projects