Volta — Anomaly Detection
Situation
Fraud/anomalies are a heavily imbalanced problem: detectors must be compared honestly against ground truth.
Task
I owned the honest verdict: which detector to trust under a heavy class imbalance and in which mode to use it — for screening or for high-precision alerts. The comparison could not rest on a single catch metric.
Actions
I set up the comparison so detectors could be measured fairly on a rare class: what matters is not only the catch but the price of false alarms. So I assembled features first, ran each detector, and scored the output against the labels.
Data preparation. I built a feature set per event: amount, hour of day and transaction frequency. I normalised the amount scale so outliers would not set the scale for everything else, and labelled every record against ground truth.
Baseline. First I took a simple Z-score threshold: how far an object sits from the mean in units of spread. It is a clear and precise but cautious estimate — it flags only the most obvious outliers.
Robust threshold. Second, IQR: it looks for points beyond the interquartile range and so tolerates heavy tails where the mean is biased. It is a compromise between simplicity and robustness.
Model. Third, Isolation Forest: it isolates anomalies by random splits and catches combined clusters such as ‘night hours and large amount’ that one-dimensional thresholds miss.
Validation. I computed precision, recall and F1 for each detector against the labels and looked at where detectors gain by paying in false alarms. That exposed the mode in which each method belongs.
Result
- Isolation Forest has the best F1 (50.4%, 401 detections).
- Z-score is precise but cautious: precision 80.5% at recall 24.7% (123 detections).
- IQR is a compromise but trails IF.
Recommendations
- IF for broad screening, Z-score for high-precision alerts.
- Monitor the ‘night hours × large amount’ clusters.
- Calibrate the threshold to the acceptable false-positive rate.