Create Sales Forecast with Prophet

How to Create a Forecast using Prophet

Sung Kim
9 min readApr 19, 2022

This is a tutorial on how to create a forecast using Prophet. Forecasting is a process of making predictions of the future based on past data and its trends. The accuracy of the forecast decreases as you stretch out your forecast. For example, if you are forecasting monthly sales then the accuracy of the forecast for the month 1 sales forecast will be higher than the month 2 sales forecast, and so on. One of my co-workers likes to state that the best way to predict tomorrow’s weather is to assume it is similar to today’s weather (i.e., Markov Chain). Everything else is just a guess.

Prophet is a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It works best with time series that have strong seasonal effects and several seasons of historical data. Prophet is robust to missing data and shifts in the trend, and typically handles outliers well per Prophet website (https://facebook.github.io/prophet/).

To maintain the brevity of a tutorial, some of the important steps are not referenced in this tutorial. For a complete code walk-through, please refer to the Github repository referenced in the Resource section at the end of this tutorial. This tutorial was created for me as reference material, therefore the tutorial is heavy on how-to, not on algorithms.

Prerequisites

--

--

Sung Kim

A business analyst at heart who dabbles in ai engineering, machine learning, data science, and data engineering. threads: @sung.kim.mw