1️⃣ Load the data
import pandas as pd
from prophet import Prophet
df = pd.read_csv('data.csv')
df.head()
2️⃣ Fit the model
m = Prophet()
m.fit(df)
3️⃣ Predict the future
Predicting 1 year into the future
future = m.make_future_dataframe(periods=365)
future.tail()
forecast = m.predict(future)
forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail()
4️⃣ Visualize the results
Interact with the time range buttons and sliding window (click and drag in the lower to set a window)
from prophet.plot import plot_plotly, plot_components_plotly
plot_plotly(m, forecast)