How We Tested
We tested anomaly detection the way you use it: records arrive one at a time, each is checked against the range computed before it, and then a new range is computed with the record included. Nobody classifies anything during the test, so unclassified problems stay in the history, as they do between your reviews. Each test was run three times, once per sensitivity level, with the other settings at their defaults.
Test Data
- Synthetic profiling metrics. 90 metrics that imitate what Blindata profiles, in 10 types (the rows of the tables below): row counts that grow with a dip at weekends, append-only tables, null and distinct percentages, small counts, hours since the last load, constant column counts, means and standard deviations, metrics profiled on weekdays only or at drifting times, a weekly metric, and hourly metrics with a daily or an office-hours cycle. Each metric has 300 records (the weekly metric 150; hourly metrics 720, that is 30 days), and 3 to 6 problems were added at random times, sized 4 to 8 times the metric’s own noise: spikes, drops, values stuck at zero, jumps in null percentage, and lasting changes of level (413 problems in all). A flag on a problem counts as a detection; any other flag counts as a false alert. The metrics were generated with a fixed random seed set aside before any result was looked at, and no setting was tuned on them.
- Public data: the Numenta Anomaly Benchmark (NAB). Five real series with events labelled by the benchmark’s authors: daily taxi trips in New York (the 30-minute counts added up per day; 5 events: a marathon, Thanksgiving, Christmas, New Year and a blizzard), the temperature of an industrial machine (hourly; 4 known failures), the CPU usage of a cloud server (hourly; 1 event), the number of tweets mentioning Apple (hourly; 4 events), and a flat signal with no events. A flag inside a labelled window counts as a detection; any other flag as a false alert.
On every series, the first 60 records are used for training only and are not scored.
Normal Records Flagged, by Type of Metric
The share of normal records flagged as anomalies (false alerts), at each sensitivity. With daily profiling, 1% is about 4 false alerts per metric per year.
| Type of metric | Metrics | Normal records | High | Medium | Low |
|---|---|---|---|---|---|
| Row counts and table volumes | 15 | 3,460 | 3.6% | 2.7% | 2.0% |
| Null and distinct percentages | 10 | 2,329 | 1.0% | 0.5% | 0.0% |
| Null percentages almost always zero | 5 | 1,144 | 1.6% | 1.6% | 1.6% |
| Small counts (nulls, rare events) | 10 | 2,349 | 0.9% | 0.2% | 0.1% |
| Freshness (hours since the last load) | 5 | 1,178 | 1.8% | 0.8% | 0.1% |
| Constant metrics (column count) | 5 | 1,158 | 0.0% | 0.0% | 0.0% |
| Value statistics (mean, standard deviation, long-tailed values) | 15 | 3,482 | 2.5% | 1.8% | 1.1% |
| Irregular schedules (weekdays only, drifting run times, weekly) | 15 | 2,730 | 2.5% | 1.5% | 1.1% |
| Hourly, daily cycle | 5 | 3,252 | 1.8% | 1.2% | 0.6% |
| Hourly, office-hours weekly cycle | 5 | 3,256 | 5.1% | 4.4% | 3.1% |
| All synthetic metrics | 90 | 24,338 | 2.4% | 1.7% | 1.2% |
Problems Detected, by Type of Metric
| Type of metric | Problems | High | Medium | Low |
|---|---|---|---|---|
| Row counts and table volumes | 64 | 57 (89%) | 56 (88%) | 50 (78%) |
| Null and distinct percentages | 48 | 48 (100%) | 47 (98%) | 43 (90%) |
| Null percentages almost always zero | 28 | 25 (89%) | 25 (89%) | 25 (89%) |
| Small counts (nulls, rare events) | 51 | 50 (98%) | 47 (92%) | 43 (84%) |
| Freshness (hours since the last load) | 22 | 21 (95%) | 21 (95%) | 17 (77%) |
| Constant metrics (column count) | 26 | 26 (100%) | 26 (100%) | 26 (100%) |
| Value statistics (mean, standard deviation, long-tailed values) | 70 | 63 (90%) | 58 (83%) | 47 (67%) |
| Irregular schedules (weekdays only, drifting run times, weekly) | 58 | 56 (97%) | 52 (90%) | 45 (78%) |
| Hourly, daily cycle | 24 | 19 (79%) | 19 (79%) | 16 (67%) |
| Hourly, office-hours weekly cycle | 22 | 6 (27%) | 6 (27%) | 5 (23%) |
| All synthetic metrics | 413 | 371 (90%) | 357 (86%) | 317 (77%) |
By kind of problem, on all synthetic metrics:
| Kind of problem | Problems | High | Medium | Low |
|---|---|---|---|---|
| Spike (one record far too high) | 161 | 96% | 93% | 81% |
| Drop (one record far too low, such as a failed load) | 120 | 83% | 79% | 66% |
| Value stuck at zero | 57 | 93% | 93% | 91% |
| Jump in null percentage | 39 | 92% | 90% | 82% |
| Lasting change of level | 36 | 75% | 67% | 64% |
Public Data (NAB)
| Series | Grid | Normal records | Known events | Normal records flagged (High · Medium · Low) | Events detected (High · Medium · Low) |
|---|---|---|---|---|---|
| New York taxi trips | daily | 128 | 5 | 6.3% · 5.5% · 3.1% | 5 · 5 · 4 |
| Machine temperature | hourly | 1,637 | 4 | 2.1% · 1.4% · 0.7% | 3 · 3 · 3 |
| Cloud server CPU | hourly | 248 | 1 | 2.0% · 2.0% · 1.2% | 1 · 1 · 1 |
| Tweets mentioning Apple | hourly | 1,130 | 4 | 2.1% · 1.9% · 1.4% | 4 · 4 · 4 |
| Flat signal | hourly | 276 | 0 | 0% · 0% · 0% | none to detect |
At Low, the New York marathon is missed; the third machine failure is missed at every level.
Figure 1. A table with fewer rows at weekends (synthetic test data). Each record was checked against the range computed just before it (shaded), then the range was updated. The range follows the weekly dip; the added problems (amber) are flagged.
Figure 2. Daily taxi trips in New York, autumn 2014 (NAB). The weekly pattern is learned; the known events (amber) are flagged, and a few days next to the holidays are flagged too.
Figure 3. Hours since a table was last loaded, for a table loaded on weekdays only (synthetic test data). The long gaps at weekends are normal and are not flagged; the added problems (amber) are. The two flags in mid-March and early April are false alerts.
Reading the Results
- Medium is the best balance. Moving from Medium to High detects 14 more of the 413 problems (+3 points) for 0.7 points more false alerts. Moving to Low cuts false alerts by a third but misses 40 more problems (about one in four in all), mostly spikes and drops.
- More false alerts than the target. At Medium the range aims at about 0.3% of normal records, and the tests flag 1.7%. Most of the difference comes from the moments when a metric changes: right after training, right after each added problem, and after a lasting change of level, the forecasts miss more than usual until the history catches up. Real metrics change less often than the test metrics, which hold 3 to 6 problems each.
- Null percentages that are almost always zero flag about 1.6% of normal records at every level. The range sits at 0%, the value the metric holds on most days, so the records flagged are the occasional small nulls: for such a metric, any new null is unusual. If small nulls are normal for a column, classify these alerts as False Positive and the range opens up.
- Constant metrics are not affected by the sensitivity: their range has no width, so any change is flagged, and every added problem was detected with no false alert. A one-off problem does not move the expected value, so the record that comes back to the usual value right after it is not flagged.
- Hourly metrics with an office-hours cycle need three weeks of history before the weekly cycle is learned. Until then, quiet nights and weekends look like problems and real problems look like quiet hours: they are the weakest type in the tests.
- Long-tailed values (metrics that often jump high as normal behaviour) get a wide range, so about half the problems added to them looked like normal jumps and were not flagged at Medium.
These are test data, not your data: results on your metrics depend on how regular they are. Use the sensitivity, and the False Positive and Anomaly classifications, to adjust each monitor.
Known Limits
- No holiday calendar. Holidays and other calendar events are not known in advance: a quiet bank holiday can be flagged. Classify it as False Positive.
- Days and hours are in UTC. Weekly and daily patterns are learned on UTC days and hours. A metric that follows local time can shift against its pattern at a daylight-saving change.
- A lasting change gives up to 3 alerts before the range adapts (Step 3 ). The other side of the same rule: a problem that lasts 3 or more runs is then treated as the new level, unless its records are classified as Anomaly.
- After a change of behaviour that is not a jump (a new load schedule, a gradual drift), the range adapts only as new records arrive; until then more records are flagged.
- Several records in one grid period are averaged. For a metric on a daily grid profiled twice a day, the model learns from the daily average. Each record is still checked on its own.
- Only the latest 1,000 records are used: for an hourly metric, about six weeks.
- Patterns are found on hourly and daily grids only, and one per metric (an hourly metric gets the hour of the day or the hour of the week, not both). On Automatic, metrics profiled every 30 minutes or every 2 hours are put on an hourly grid and get the hourly patterns. A metric whose Frequency is set to another step (
2h,30min,6h), and weekly and monthly metrics, get no pattern. Why:- The service looks only for calendar cycles (day of the week, hour of the day, hour of the week), the ones loads and business activity follow. Searching for any repeating length would, on a short and noisy history, often find a pattern that is only chance.
- A cycle has to be counted in steps of the grid and recognised over three full cycles within the latest 1,000 records. Some combinations can never fit: a weekly cycle on a 30-minute grid needs 1,008 records, a yearly cycle on a weekly grid three years of history. The others (a daily cycle on a 2-hour or 30-minute grid) would fit, but the detection has been tested on hourly and daily grids only, so it is not applied to them. To get a pattern on such a metric, leave its Frequency on Automatic or set it to hourly.
- One pattern is enough on an hourly metric: the hour of the week already holds a daily shape for each day. The hour of the day is kept unless the weekly pattern is clearly better, because it needs three days of history instead of three weeks and is steadier.
- A recurring state that is not weekly or daily widens the range every day. A metric that drops to half every tenth day keeps those drops in its history (they are too frequent to be spikes), but the service does not know when the next one is due. The lower bound then reaches down to the dip on every day, so a drop of up to that depth on another day is not flagged.
- Metrics with frequent large jumps as normal behaviour get a wide range, so problems of the same size as those jumps are not flagged.
- Not every record is checked. No record is checked before the metric has its Minimum Training Data, after an error of the forecasting service, or after the last point of the latest range.