DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to flag anomalies in a multivariate series with Darts

Score a series with a k-means anomaly scorer and turn the scores into binary anomaly flags.

Short answer: Install it with pip install darts; then load a series and split it, for example train, val = series.split_before(0.6); Fit a scorer with KMeansScorer(k=2, window=5) on the train set and score the validation set. All steps.

  • Data and analytics
  • Intermediate
  • 45 minutes
  • From the README
  • Claude Code
  • Codex
  • Cursor
  • Gemini CLI

Who it is forAn engineer watching sensor or ops metrics for unusual behaviour.

The problemFixed thresholds miss context and fire constantly.

The outcomeAn anomaly score series plus a binary anomaly classification.

What you need first

  • Python 3.11 or newer, ideally in a clean environment
  • `pip install darts`
  • Your series as a pandas DataFrame or one of the supported backends

Steps

  1. Install it with pip install darts
  2. Load a series and split it, for example train, val = series.split_before(0.6)
  3. Fit a scorer with KMeansScorer(k=2, window=5) on the train set and score the validation set
  4. Fit QuantileDetector(high_quantile=0.99) on the train scores and call detect on the validation scores

Prompt for your agent

With unit8co/darts, build a KMeansScorer and QuantileDetector pipeline over <my metric series> and list the timestamps it flags as anomalies.

Caveat. The quantile detector is calibrated on the training scores, so retrain it when the baseline shifts.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for unit8co/darts and "Flag anomalies in a multivariate series"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer