Skip to content

Commit

Permalink
FEAT: online anomaly detection (#546)
Browse files Browse the repository at this point in the history
Co-authored-by: yibeihu <yibei2022@163.com>
Co-authored-by: Yibei Hu <115324670+Yibei990826@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 8, 2025
1 parent e96df1f commit b71a976
Show file tree
Hide file tree
Showing 17 changed files with 2,694 additions and 610 deletions.
49 changes: 0 additions & 49 deletions nbs/docs/capabilities/anomaly-detection/00_anomaly_detection.ipynb

This file was deleted.

220 changes: 0 additions & 220 deletions nbs/docs/capabilities/anomaly-detection/02_anomaly_exogenous.ipynb

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "6de758ee-a0d2-4b3f-acff-eed419dd17c5",
"metadata": {},
"source": [
"# Historical anomaly detection"
]
},
{
"cell_type": "markdown",
"id": "5d267032-535b-4b7b-b7d3-d2db8f673af6",
"metadata": {},
"source": [
"This section provides various recipes for performing historical anomaly detection using TimeGPT.\n",
"\n",
"Historical anomaly detection identifies data points that deviate from the expected behavior over a given historical time series, helping to spot fraudulent activity, security breaches, or significant outliers.\n",
"\n",
"The process involves generating predictions and constructing a 99% confidence interval. Data points falling outside this interval are considered anomalies.\n",
"\n",
"This section covers:\n",
"\n",
"* [Historical anomaly detection](https://docs.nixtla.io/docs/capabilities-historical-anomaly-detection-quickstart)\n",
"\n",
"* [Historical anomaly detection with exogenous features](https://docs.nixtla.io/docs/capabilities-historical-anomaly-detection-add_exogenous_variables)\n",
"\n",
"* [Historical anomaly detection with date features](https://docs.nixtla.io/docs/capabilities-historical-anomaly-detection-add_date_features)\n",
"\n",
"* [Modifying the confidence intervals](https://docs.nixtla.io/docs/capabilities-historical-anomaly-detection-add_confidence_levels)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "python3",
"language": "python",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"source": [
"# Quickstart\n",
"\n",
"To perform anomaly detection, use the `detect_anomalies` method. Then, plot the anomalies using the `plot` method."
"To perform historical anomaly detection, use the `detect_anomalies` method. Then, plot the anomalies using the `plot` method."
]
},
{
Expand All @@ -73,7 +73,7 @@
"#| echo: false\n",
"if not IN_COLAB:\n",
" load_dotenv()\n",
" colab_badge('docs/capabilities/anomaly-detection/01_quickstart')"
" colab_badge('docs/capabilities/historical-anomaly-detection/01_quickstart')"
]
},
{
Expand Down Expand Up @@ -176,7 +176,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"For an in-depth guide on anomaly detection with TimeGPT, check out our [tutorial](https://docs.nixtla.io/docs/tutorials-anomaly_detection)."
"For an in-depth guide on historical anomaly detection with TimeGPT, check out our [tutorial](https://docs.nixtla.io/docs/tutorials-anomaly_detection)."
]
}
],
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"source": [
"# Add confidence levels\n",
"\n",
"Tweak the confidence level used for anomaly detection. By default, if a value falls outside the 99% confidence interval, it is labeled as an anomaly.\n",
"Tweak the confidence level used for historical anomaly detection. By default, if a value falls outside the 99% confidence interval, it is labeled as an anomaly.\n",
"\n",
"Modify this with the `level` parameter, which accepts any value between 0 and 100, including decimals.\n",
"\n",
Expand Down Expand Up @@ -77,7 +77,7 @@
"#| echo: false\n",
"if not IN_COLAB:\n",
" load_dotenv()\n",
" colab_badge('docs/capabilities/anomaly-detection/04_confidence_levels')"
" colab_badge('docs/capabilities/historical-anomaly-detection/04_confidence_levels')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Online (Real-Time) Anomaly Detection"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Online anomaly detection dynamically identifies anomalies as data streams in, allowing users to specify the number of timestamps to monitor. This method is well-suited for immediate applications, such as fraud detection, live sensor monitoring, or tracking real-time demand changes. By focusing on recent data and continuously generating forecasts, it enables timely responses to anomalies in critical scenarios.\n",
"\n",
"This section provides various recipes for performing real-time anomaly detection using TimeGPT, offering users the ability to detect outliers and unusual patterns as they emerge, ensuring prompt intervention in time-sensitive situations.\n",
"\n",
"This section covers:\n",
"\n",
"* [Online anomaly detection](https://docs.nixtla.io/docs/capabilities-online-anomaly-detection-quickstart)\n",
"\n",
"* [How to adjust the detection process](https://docs.nixtla.io/docs/capabilities-online-anomaly-detection-adjusting_detection_process.ipynb)\n",
"\n",
"* [Univariate vs. multiseries anomaly detection](https://docs.nixtla.io/docs/capabilities-online-anomaly-detection-univariate_vs_multivariate_anomaly_detection)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}
400 changes: 400 additions & 0 deletions nbs/docs/capabilities/online-anomaly-detection/01_quickstart.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit b71a976

Please sign in to comment.