I take this opportunity to express my sincere thanks to Data Science Dojo and Mr. Nicholas Renotte for conducting an amazing webinar on FB prophet where I got to learn about this amazing framework by Facebook. Following the instructions I worked on the same dataset as in the webinar and got a thorough understanding of many concepts. This small project was an amazing journey of learning and I have enclosed some of the links which have helped me during my journey to make this project with some resource guides for future improvements and learnings.
- Nicholas Renotte
- FB PROPHET
- TIME SERIES FORECASTING WITH PYTHON
- GENERATE QUICK AND ACCURATE TIME SERIES FORECAST
- TIME SERIES ANALYSIS WITH FACEBOOK PROPHET
- STAN
- TIME SERIES PREDICTION WITH LSTM RNN
- DEVELOP LSTM MODEL FOR TIME SERIES FORECASTING
- LSTM FRAMEWORK FOR UNIVARIATE TIME SERIES PREDICTION
- MULTIVARIATE TIME SERIES FORECASTING
- MULTIVARIATE MULTI-STEP TIME SERIES FORECASTING
- STOCK PREDICTION USING FB PROPHET
- KAGGLE NOTEBOOK ON PROPHET
- HOW DOES FB PROPHET WORK
- ABOUT FB PROPHET
According to Sean Taylor, a research scientist at Facebook and Stan user told that, Prophet uses Stan for optimization (and sampling if the user desires) in order to fit a non-linear additive model and generate uncertainty intervals. The advantages they got by using STAN was:
- STAN does a great job of letting a user separate optimization from the model code.
- It could share the same core implementation in both python and R.
Prophet is automatically detect changepoints in the time series by specifying a sequence potential parameter changes and shrinking the shifts using a Laplace prior. The user is allowed to adjust the flexibility of the model by tuning precision of priors, which is intuitive for most users. At its core, the Prophet procedure is an additive regression model with four main components:
-
A piecewise linear or logistic growth curve trend. Prophet automatically detects changes in trends by selecting changepoints from the data.
-
A yearly seasonal component modeled using Fourier series.
-
A weekly seasonal component using dummy variables.
-
A user-provided list of important holidays. In layman terms, we can understand it as follows: FBProphet uses decomposable time series model with 3 main components: seasonal, trends, holidays or events effect and error which are combined into this equation:
f(x) = g(x) + s(x) + h(x) + e(t)
FBProphet uses time as a regressor and tries to fit several linear and nonlinear function of time as components. By default, FBProphet will fit the data using a linear model but it can be changed to the nonlinear model (logistics growth) from its arguments.
I would recommend using Google Colab or Kaggle notebook because installing FB Prophet on your local PC can be quite a hassle
Run all the cells of the notebook FB_PROPHET.ipynb to see prophet working on the dataset.
I have used a toy tesla data set which has been highly curated for starters in FB Prophet.
- Adding more data to perform better predictions.
- Adding parameters to take care of holidays and seasons.