The Datapred blog

On machine learning, time series and how to use them.

A better Facebook Prophet

Posted by Datapred | Oct 9, 2018 2:30:17 PM

What is Facebook's Prophet?

Prophet is a forecasting (i.e. time-series specific) algorithm open-sourced by Facebook in February 2017, and belonging to the GAM family of algorithms.

Prophet was developed for typical Facebook issues, such as predicting user activity in different parts of their app, or prioritizing feature development. It is thus convenient for prediction challenges involving multiple seasonalities and special events (single-day events like Black Friday, or longer events like school holidays).

Prophet is relatively easy to use: it is available in R and Python, it is quite robust "out of the box" thanks to its automatic outlier filtering and parameter tuning capabilities, and its interface is straightforward.

These advantages explain why Prophet has become popular with data scientists working on demand prediction challenges. We would definitely recommend it as a first iteration, especially if your data is highly seasonal.


Notable downsides

Prophet was never meant to be an all-purpose predictive algorithm, and its downsides reflect its specialization.

  • If you need to predict hundreds or thousands of targets simultaneously, Prophet will compute slowly. You will need to adapt it to multivariate forecasting by coding multiple loops and storing multiple predictions. And Prophet won’t cross-learn potentially useful patterns from multiple targets.
  • If you have more meaningful features than just seasonality or special events, Prophet won't help. That's a big limitation in a lot of situations. Even plain-vanilla demand prediction challenges often involve a multi-level product hierarchy and some contextual data.
  • If you are exposed to unexpected changes in the underlying structure of your data (a very common risk with time series), you will need to manage Prophet’s relearning procedure manually. The hassle intensifies exponentially when you multiply data types, prediction targets and prediction horizons.

How to improve it

Here are a few suggestions for improving your implementation of Prophet:

  • You could automate Prophet's relearning procedure to increase its resistance to changes in the underlying structure of your data.
  • You could aggregate it with other, complementary predictive algorithms (e.g. LSTM, ARIMA) and use their best combined predictions.
  • You could also implement real GAM algorithms, that you could then tailor to your specific prediction challenge.

Datapred will automate all three points for you, and ensure the corresponding code is production-ready. Contact us to discuss a trial with us. You can also visit this page for links to useful resources on time series modeling.

Specificities time series-1


Topics: machine learning, demand prediction, Prophet, predictive analysis, facebook

Written by Datapred