/anomaly-detection-tutorial

A hands-on tutorial on anomaly detection in time series data using Python and Jupyter notebooks. This repository includes interactive live-coding sessions, sample datasets, and various anomaly detection algorithms to provide a comprehensive learning experience.

Primary LanguageJupyter NotebookMIT LicenseMIT

Anomaly Detection Tutorial

This repository contains materials for a hands-on tutorial on Anomaly Detection in Time Series. The tutorial includes interactive live-coding sessions in Jupyter notebooks, using Python and various anomaly detection algorithms from the TSB-UAD Benchmark.

Important ressources

  • TSB-UAD (github): labeled time seires anomaly detection Datasets and methods
  • TSB-kit (github,doc): Time seires anomly detection library supporting TSB-UAD
  • MSAD (github): Model selection for time series anoamly detection
  • ADecimo (github, streamlit): Tool for exploring and comparing model selection for time series anoamly detection

Getting Started

To get started with the tutorial, follow the instructions below:

1. Clone the Repository

First, clone the repository to your local machine:

git clone https://github.com/sylligardos/anomaly-detection-tutorial.git
cd anomaly-detection-tutorial

2. Download the Dataset

Download the ‘Public’ dataset from the TSB-UAD benchmark:

  1. Visit github.com/TheDatumOrg/TSB-UAD.
  2. Download the dataset from this link, or the smaller sample from this link.
  3. Unzip the dataset.
  4. Move the ‘TSB-UAD-Public’ directory into the anomaly-detection-tutorial/data/ directory.

3. Set Up the Conda Environment

Make sure you have Conda installed, then create and activate the environment:

conda create --name tutorial python=3.8.13
conda activate tutorial
pip install tsb-kit
pip install jupyter

4. Open the Tutorial Notebook

Start the Jupyter Notebook server and open the tutorial notebook:

jupyter notebook

In the Jupyter Notebook interface, open the notebooks/tutorial_paris_2024.ipynb notebook.

Usage

The notebooks provided in this repository guide you through various anomaly detection techniques and their applications in time series. Follow along with the instructions in each notebook to learn and implement different methods.