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 various sections of the Facebook website and mobile 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

However and contrary to what many data scientists seem to believe, Prophet was never meant to be an all-purpose predictive algorithm. It has notable downsides, which reflect its specialization.

  • Prophet will compute slowly if you need to predict hundreds or thousands of targets simultaneously. That is typically the case in retail and logistics, where managers require sales predictions across multiple product categories, or POS delivery predictions for entire regions. In such cases, you will need to adapt Prophet to multivariate forecasting by coding multiple loops and storing multiple predictions. And Prophet won’t cross-learn potentially useful patterns from all these targets (for example, ice cream and swimsuit sales moving together).
  • 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 (for example, weather information for ice cream sales) .
  • 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 combine data types, prediction targets and prediction horizons.

How to improve it

Here are a few tactics we have found usefull for improving your implementation of Prophet:

  • You could automate Prophet's relearning procedure (matching data volatility and/or decision frequency) 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's modeling engine automates all three points, and ensures 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

Written by Datapred

Recent Posts

Topics

Subscribe