Life news: I got a dog

Categories

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, DavisShaver.com 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()
m.fit(df);
future = m.make_future_dataframe(periods=365)
forecast = m.predict(future)
m.plot(forecast);

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

Your ad blocker is on.

Read ad free.

Sign up for our e-mail newsletter:
OR
Support quality journalism:
Purchase a Subscription!

Comments

Real publishers, real problems, real opportunities

Here is a copy of my presentation and prepared remarks from WordCamp for Publishers 2019 in Columbus.

Chris Gethard & Mal Blum – Crying At The Wawa (Official Video)

Old but new to me.

Send this to a friend