Anomaly detection in time series

adtk is the anomaly detection module.
It is rule-based unsupervised anomaly detection in time series.

Here is how my chart will look like in most cases.

import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline

rand = np.random.RandomState(123)
s = pd.Series(
    np.cumsum(rand.normal(size=300)),
    index=pd.date_range(start=”2017-1-1″, periods=300, freq=”D”),
)

plt.plot(s)

In order to find and plot outliers, I will need only 4 lines of code.

from adtk.visualization import plot
import adtk.detector as detector
anomaly = detector.QuantileAD(low=0.05, high=0.95).fit_detect(s, return_list=False)
plot(s, anomaly)

#pip install adtk

Powered by WPeMatico