Bank Transaction Fraud Analytics
Full EDA on a large-scale banking transaction dataset to surface spending patterns and behavioral anomalies, with supervised and unsupervised detectors benchmarked on precision, recall, and F1 rather than accuracy.
Key result
3 detectors— Benchmarked on precision, recall, and F1
01Problem
Fraudulent transactions are a tiny fraction of total volume, which makes them easy to miss and easy to fake success against — a model that predicts 'not fraud' every time still scores over 99% accuracy.
02Objective
Characterize fraud patterns through exploratory analysis, then compare supervised and unsupervised detectors on metrics that survive class imbalance.
03Architecture
- Transaction Data
- Exploratory Analysis
- Feature Engineering
- Detector Benchmarking
- Evaluation
04Technology
- Python
- Pandas
- scikit-learn
- Random Forest
- Isolation Forest
- K-Means
- Matplotlib
05Implementation
Key technical decisions
- 01Compared detectors on precision, recall, and F1 rather than accuracy, which is uninformative at this class imbalance.
- 02Included an unsupervised anomaly detector alongside the supervised model, since novel fraud has no label to learn from.
- 03Segmented customers by behavior to see whether flagged activity concentrates rather than spreading evenly.
What was built
- Pandas pipeline for cleaning and per-customer aggregation.
- Matplotlib distribution and correlation plots contrasting fraud against baseline behavior.
- Random Forest as the supervised detector, Isolation Forest as the label-free comparison.
- K-Means segmentation over behavioral features.
- Precision, recall, and F1 reported for each detector.
06Data
Transaction dataset
- Large-scale banking transaction records with a labeled fraud flag
- Transaction amount, timestamp, channel, and merchant category
- Customer identifiers supporting per-account aggregation
- Severely imbalanced classes — fraud is a small minority of rows
07Results
3
Detectors benchmarked
P / R / F1
Evaluation metrics used
Segmented
Customers grouped by behavior