microprediction/timemachines

Temporal online machines: streaming anomaly detection with calibrated p-values, built on skaters

What it solves

It provides a way to detect anomalies in streaming data with controlled false-alarm rates. Instead of relying on manually tuned thresholds, it uses calibrated p-values to ensure that the rate of false alarms remains approximately equal to a pre-defined significance level (alpha).

How it works

The project uses a "body and head" architecture. A "body" (provided by the skaters library) acts as a calibrated online forecaster that transforms raw data streams into a stream of standardized surprises (z-scores). This creates a stable "null model" where the data behaves like independent and identically distributed normal noise.

"Heads" then process these surprise streams to make decisions. For example, the wald machine uses a Wald statistic to emit calibrated p-values, allowing the user to trigger alarms based on a specific false-alarm probability rather than an arbitrary threshold.

Who it’s for

Data scientists and engineers working with real-time streaming data who need reliable anomaly detection without the burden of manual threshold tuning or the risk of high false-alarm rates.

Highlights

  • Calibrated Error Rates: Uses p-values to control false-alarm rates (e.g., setting a threshold of 1e-4 results in a false-alarm rate of approximately 0.01%).
  • One-Pass Processing: Designed for streaming data with constant memory and strictly causal operations, meaning it never looks ahead at future data.
  • Forecaster-First Approach: By transforming raw data into surprise streams first, it improves the performance of other existing anomaly detectors.
  • Composable Architecture: Separates the forecasting logic (bodies) from the decision logic (heads), allowing for easy swapping of components.

Related

  • Project
  • Project
  • Project
  • Project
  • Project