Forecasting as an anomaly detection tool
Another approach to anomaly detection involves forecasting. This strategy uses a forecasting model to predict future values and treats any significant deviations from these predictions as anomalies. Facebook’s Prophet library, which allows for robust, automatic forecasting, is well suited for this task.
However, one major drawback of this technique is its inefficiency with low-frequency data. If a time series isn’t observed frequently enough for a model to accurately forecast, the prediction intervals may be too wide, making anomaly detection challenging. As covered in the previous chapter, forecasting models rely on patterns within the data to make accurate predictions. If these patterns are not well defined due to sparse data, the model’s forecasts will have a higher degree of uncertainty.
Prediction intervals are a way of expressing this uncertainty. A prediction interval gives a range within which we expect the...