Prophet by Facebook, easy forecasting of timeseries data

Forecasting is a common problem in the publishing industry, most notably during budget season, and Facebook’s Prophet might come in handy next time you face yourself having to predict next year’s traffic.

Prophet is a new open source project than can be used with R or Python to predict some value into the future, breaking out along day of week and months to highlight seasonality.

Only hurdle to snag me was using system Python over virtualenv or pyenv. Matplotlib needed to be in a “framework” version of Python, a requirement which these virtualized environments didn’t satisfy.

Here’s a simple 3-year project of sessions on this site. As you can see, isn’t a particularly high traffic domain, but at least it’s growing!

This prediction data comes from just a few lines of code…

import pandas as pd
import numpy as np
from fbprophet import Prophet
df = pd.read_csv('./test.csv')
df['y'] = np.log(df['y'])
m = Prophet();
future = m.make_future_dataframe(periods=365)
forecast = m.predict(future)

Definitely worth checking out next time you need to predict something!

Feb. 26 2017, 4:32 pm