Time Series Anomaly Detection Using Prophet in Python
How to train a time series model, make predictions, and identify outliers using a Prophet model?
This tutorial will talk about how to do time series anomaly detection using Facebook (Meta) Prophet model in Python. Anomalies are also called outliers, and we will use these two terms interchangeably in this tutorial. After the tutorial, you will learn:
- How to train a time series model using Prophet?
- How to make predictions using a Prophet model?
- How to identify outliers using a Prophet time series forecast?
Resources for this post:
- Video tutorial for this post on YouTube
- Python code is at the end of the post. Click here for the notebook.
- More video tutorials on anomaly detection and time series
- More blog posts on anomaly detection and time series
Let’s get started!
Step 0: Algorithm for Time Series Anomaly Detection
In step 0, let’s talk about the algorithm for time series anomaly detection. At a high level, the outliers are detected based on the prediction interval of the time series. The implementation includes the following steps: