> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Anomaly detection

> How Openlayer detects and explains unexpected changes in your tables

Openlayer’s anomaly detection helps you spot **unexpected changes in production data** with
minimal setup. It powers the [Anomaly detection test](https://docs.openlayer.com/tests/catalog/anomalous-column-count.md) and flags
when metrics for a column deviate from their learned “normal” behavior.

## What it monitors

For each table you connect, Openlayer maintains time series for:

* **Numeric columns** — the **mean** daily value over time.
* **Categorical columns** — the **counts** of the daily **top categories** over time.

These series are learned per column and continuously updated as new data arrives.

## How detection works

Behind the scenes, what Openlayer is doing is:

**1. Learn**

We fit time-series models per monitored metric (numeric mean, categorical
counts). The model captures trend/seasonality and estimates an **expected
range** (upper & lower bounds) for each evaluation window.

**2. Predict**

For the current window, the model predicts the upper and lower bounds.

**3. Compare**

We compare the **observed value** with the predicted range. If the observed
value is outside the predicted range, it is flagged as an anomaly.

**4. Adapt**

Models are **retrained regularly** so the expected range improves as your
data evolves.

## Visualizing results

When an anomaly is detected, the result view shows:

* A **time-series chart** with the observed value and the **expected range band**.
  Green points fall within the band; orange points indicate anomalies.
* A **per-column selector** to inspect any monitored metric individually.

![Time series](https://mintcdn.com/openlayer-44/O1_M9YHCON_OMJql/images/documentation/time_series.png?fit=max\&auto=format\&n=O1_M9YHCON_OMJql\&q=85\&s=88a7761f20c5764e503c3546ec8b4317)

## Root-cause analysis (RCA)

For **categorical** anomalies, the Diagnostics tab includes **RCA**:

* Pick one or more categorical columns.
* See which **values were predominant** when the anomaly occurred.
* Use this to quickly form hypotheses (e.g., “spike only for `to_address = X`”),
  trace pipeline issues, or decide whether to suppress a benign seasonal effect.

  ![Root-cause analysis](https://mintcdn.com/openlayer-44/O1_M9YHCON_OMJql/images/documentation/rca.png?fit=max\&auto=format\&n=O1_M9YHCON_OMJql\&q=85\&s=17b548d410e5a20628d94ec78c4ac952)

## Configuration tips

* **Confidence interval (`interval_width`)**
  Smaller interval → **more sensitive** (more anomalies). Larger interval → less sensitive.
* **Timestamp column**
  Required so Openlayer can order data by time and form windows.
* **Cold start**
  New tables need some history to build a reliable baseline. Early bounds may be wider until the
  model learns seasonality.

## FAQ

> [accordion] What exactly is considered an anomaly?
>
> A per-window value (numeric mean or categorical count) that falls
> **outside** the model’s predicted upper/lower bounds for that column.

> [accordion] Does it detect spikes and drops?
>
> Yes—both excursions above the upper bound and below the lower bound are
> flagged.

> [accordion] Will it learn seasonality (weekends, end-of-month, etc.)?
>
> Yes. As history grows, bounds adapt to recurring patterns, reducing false
> positives.

> [accordion] Can I be alerted?
>
> Yes. Create an [Anomaly detection
> test](https://docs.openlayer.com/tests/catalog/anomalous-column-count.md) and configure notifications on
> failures.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.