{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "unit8co-darts--detect-anomalies-in-a-series-with-darts",
 "repo": "unit8co/darts",
 "repo_url": "https://github.com/unit8co/darts",
 "repo_slug": "unit8co-darts",
 "title": "Flag anomalies in a multivariate series",
 "page_title": "How to flag anomalies in a multivariate series with Darts",
 "summary": "Score a series with a k-means anomaly scorer and turn the scores into binary anomaly flags.",
 "who": "An engineer watching sensor or ops metrics for unusual behaviour.",
 "problem": "Fixed thresholds miss context and fire constantly.",
 "outcome": "An anomaly score series plus a binary anomaly classification.",
 "steps": [
  "Install it with `pip install darts`",
  "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",
  "Fit QuantileDetector(high_quantile=0.99) on the train scores and call detect on the validation scores"
 ],
 "agent_prompt": "With unit8co/darts, build a KMeansScorer and QuantileDetector pipeline over <my metric series> and list the timestamps it flags as anomalies.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Intermediate",
 "time": "45 minutes",
 "basis": "readme",
 "caveat": "The quantile detector is calibrated on the training scores, so retrain it when the baseline shifts.",
 "category": "Data and analytics",
 "tags": [
  "Data and analytics"
 ],
 "lang": "python",
 "requirements": [
  "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/unit8co-darts/detect-anomalies-in-a-series-with-darts/",
 "md": "https://dedupedai.com/use-cases/unit8co-darts/detect-anomalies-in-a-series-with-darts/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/unit8co-darts--detect-anomalies-in-a-series-with-darts.json",
 "api_version": "v1"
}
