Problem
Fraud teams usually notice a new trend only after it grows enough to move top-line metrics, when losses have already piled up. At DoorDash the average time to detect a new trend was more than 100 days. No single order or user looks odd; the anomaly exists only in a group, such as one bank, one retailer or one country. Checking every group by hand is impossible, and naive alerts on each group flood operations with false alarms.
Example from the article: a spike in credit and refund claims at one retailer appears in {business_name = Retailer One} and in many overlapping segments containing it.
Solution in brief
Every day, compute early-warning metrics for every single, double and triple combination of dimensions (hundreds of millions of segments). Flag a segment when its latest value is far above a baseline from earlier weeks and is also large in business terms. Merge overlapping flagged segments into clusters and give analysts one representative segment per cluster.
Questions this case answers
- How to detect a slowly growing abuse pattern early when no single event is anomalous and the pattern is visible only in aggregates over many overlapping segments
- How to reduce thousands of correlated anomaly alerts over nested segments to a reviewable number of clusters per day
- How to spot a growing fraud trend within days instead of waiting until it hits top-line metrics?
- How to scan metrics across hundreds of millions of user segments for a growing anomaly every day?
Tools and methods
- Moving-window z-score — flags a series when day 28 is 6 standard deviations above the 21-day baseline mean
- Segment aggregation in DuckDB — aggregates metrics over hundreds of millions of segments in under 10 minutes
- Graph clustering of segments — merges parent, child and sibling anomalies into one cluster per trend
- Apache Airflow and Apache Spark — daily orchestration and loading of the day's data snapshot
Google or a one-time email code. No password.