anomaly
Detect anomalies in metrics — z-score, robust z-score, IQR, EWMA and seasonal residual, with scoring that does not flatter itself.
01 Generate a labelled series
Sixteen weeks of hourly request rate with a daily rhythm, a weekend dip and a slow climb. Four kinds of fault are injected and labelled: spike, dip (outage), level shift, and a variance burst. Tune the knobs and re-run.
02 How each detector scores
| detector | idea | where it fails |
|---|---|---|
| random | uniform noise | everywhere — it is the control |
| z-score | distance from the mean in σ | masking: mean and σ are dragged by the outliers |
| robust z-score | distance from the median, scaled by MAD | still blind to seasonality |
| iqr | distance outside the quartiles | same |
| ewma | distance from a moving expectation | follows a drift, so it will not report one |
| seasonal residual | subtract the daily shape, then judge | needs to know the period |
The threshold is the chosen quantile of the scores the detector produced on the series — never chosen from the labels. Strict F1 is judged point by point; point-adjusted F1 credits a whole segment from one hit, which is why the random control can look respectable on the adjusted number alone.
03 Draw your own series
Sketch a metric directly on the canvas (drag left to right). Inject labelled spikes, then run any detector on your drawing — the same JS ports of the Python detectors score it.
Pad empty — draw a line or load the preset.
04 Detector comparison dashboard
Every detector scores the current series; each score series is normalised to its own max so the shapes are comparable. The table runs the real strict/point-adjusted metrics for each detector at the quantile set above.
| detector | flags | strict P | strict R | strict F1 | point-adj F1 |
|---|
05 Threshold lab — precision / recall / F1 live
Drag the threshold along the selected detector's score axis. Flags are recomputed instantly; precision, recall and F1 (both scoring conventions) update in real time. The toggle switches which F1 is headline.