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
01—Problem
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.
02—Objective
Characterize fraud patterns through exploratory analysis, then compare supervised and unsupervised detectors on metrics that survive class imbalance.
03—Architecture
01Transaction Data
02Exploratory Analysis
03Feature Engineering
04Detector Benchmarking
05Evaluation
Analysis and evaluation workflow
04—Technology
Python
Pandas
scikit-learn
Random Forest
Isolation Forest
K-Means
Matplotlib
05—Implementation
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.
06—Data
Transaction dataset
Large-scale banking transaction records with a labeled fraud flag
Transaction amount, timestamp, channel, and merchant category