Skip to content

AdewumiA/Realtime-Anomaly-Detection

Repository files navigation

Real-time Anomaly-Detection

Real-time Anomaly detection in streaming Time series data with alert notification options using Telegram or Email.

Method 1: Rolling Window Rapid distance-based via sampling

This method is based on the research paper by Sugiyama & Borgwardt (2013).

It performs sampling once and measures the outlierness of each data point by the distance from it to the nearest neighbour in the sample set.

It was slightly modified to use a rolling window for the time-series data. The choice of window size was based on the research paper. This method has the following advantages:

  • Scalable: the time complexity is linear in the number of data points,
  • Effective: it is empirically shown to be the most effective on average among existing distance-based outlier detection methods,
  • Easy to use: it requires only one parameter, the number of samples, and a small sample size (the default value is 300), and
  • Rolling window: It ensures anomaly detection is done on the recently available data in the time series.

Method 2: Isolation Forest

The feature importance of the isolation forest was determined based on the methodology presented in "Explainable machine learning in industry 4.0: evaluating feature importance in anomaly detection to enable root cause analysis." by Carletti et al. (2019).

The unofficial implementation of the code can be found on https://github.com/AdewumiA/diffi_df, which was forked from https://github.com/britojr/diffi.

License & Usage

This project is released under a Modified MIT License.

  • Free to use for learning, personal projects, or academic research.
  • Production or commercial use is not permitted without written permission.

Attribution must be retained. To request usage rights or permissions, contact [aadewumi.d@gmail.com].

📄 See LICENSE for full terms.