Skip to content
tezvyn:

Prophet: Automated Time Series Forecasting

Source: facebook.github.ioMediumHow cards are made

Prophet: Automated Time Series Forecasting

Prophet treats forecasting like decomposing a signal, breaking a time series into trend, seasonality, and holiday effects. It excels at predicting business metrics with strong seasonal patterns, like web traffic.

The mental model

Prophet treats a time series not as a single squiggly line, but as the sum of simpler, independent signals. It decomposes the data into its core components: a long-term trend, repeating seasonal patterns (like weekly or yearly cycles), and the impact of holidays or special events. By modeling each piece separately and then adding them together, it creates a forecast.

How it works

Prophet is based on an additive model. First, it fits a non-linear trend to capture overall growth or decline, automatically detecting points where the rate of growth changes. Second, it models seasonality using a flexible Fourier series, allowing it to capture weekly and yearly patterns. Third, it incorporates the effects of holidays and one-off events, which you can provide as a custom list. The model is robust by design, gracefully handling missing data points and being insensitive to most outliers. The entire model is fit using Stan, a probabilistic programming language, which makes the fitting process fast, often taking just a few seconds.

When to use it

Use Prophet for business forecasting tasks where the time series has strong seasonal effects and at least one year of historical data. It's ideal for setting goals or planning capacity for metrics like future sales, server load, or website traffic. Its speed and high degree of automation make it a great first choice for getting a reasonable baseline forecast on messy, real-world data without significant manual effort.

When not to use it

Prophet's strengths are less relevant for time series without clear seasonal patterns. If your data is more like a random walk (e.g., stock prices), other models may be more appropriate. It also requires sufficient historical data; with less than a full year of data, it cannot effectively learn the yearly seasonal component, which is one of its key features.

One canonical example

Imagine forecasting daily page views for a popular blog. The overall trend might be upward as the site gains followers. There is strong weekly seasonality (higher traffic on weekdays) and yearly seasonality (dips during major holidays). Prophet can model this baseline automatically. An analyst could then improve the forecast by providing a custom list of "holidays" for events like a viral post or a major site redesign, which caused unusual spikes in activity.

Interview question

Which statement best describes Prophet's fundamental approach to time series forecasting?

  • a.It primarily uses statistical methods like ARIMA to extrapolate past observations into the future.
  • b.It models the time series as an additive combination of trend, seasonal, and holiday components.Correct
  • c.It focuses on identifying and removing outliers before applying a simple linear regression model.
  • d.It employs advanced deep learning architectures to capture intricate temporal dependencies.
Why?

Prophet's core mental model is to decompose a time series into an additive combination of trend, seasonality, and holiday effects, modeling each independently. Option A describes ARIMA, which is a different class of models than Prophet's additive decomposition.

Just read this? Test yourself on what you have been reading.

Read the original → facebook.github.io

You just looked this up. Could you explain it out loud?

That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on forecasting — each one lists the topics its interview covers.

See open roles