'Anomaly detection using TensorFlow Probability

I was checking for the option for anomaly detection in univariate timseries data and thought of using TensorFlow Probability anomaly_detection module.

I have daily data for 3 months which is spread between 12.5 to 20.0 range.

On every Friday I induced the value between 25.5 to 27.5.

The code worked good and did not show these values as anomalies.

My question is; for one Friday if my value is again 15.5, it should have treated it as anomaly, because on Fridays the values are expected to be between 25.5 to 27.5.

Do I need to change any parameter to consider seasonality?

My code is as below

predictions = tfp_ad.detect_anomalies(data, anomaly_threshold=0.01,
                                  use_gibbs_predictive_dist=False,
                                  num_warmup_steps=50,
                                  num_samples=100,
                                  jit_compile=False,
                                  seed=None)

Also, what is the importance of "anomaly_threshold" parameter?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source