How to forecast call volumes using Facebooks Prophet Model
Let’s start with some basics
- Sign in to Google Collab
- Create a CSV file with your dataset (the best option is to use day level dataset with at least a years worth of data)
- Make sure you name the columns as Date & Volume (otherwise you would need to edit the code a bit in step 4)
- Let’s load your data into Google Collab (use the upload to session icon)
- You are now ready to forecast !
We will use Facebook’s Prophet algorithm to forecast call volumes (To read more about it click here)
- #install prophet forecast module
! pip install prophet - # Load the necessary libraries
from prophet import Prophet
import pandas as pd - # Load the time series data
data = pd.read_csv(“/Forecast.csv”) - # Convert the data to the correct format for prophet – if you have different column names – you can change them here now
data_prophet = data.rename(columns={‘Date’: ‘ds’, ‘Volume’: ‘y’}) - # Create the prophet model
m = Prophet(changepoint_prior_scale=0.5, seasonality_mode=’multiplicative’) - # Add seasonality to the prophet model
m.add_seasonality(name=’weekly’, period=7, fourier_order=5) - # Fit the model to the data
m.fit(data_prophet) - # Create a dataframe for future predictions – we create a forecast for next 1 year
future = m.make_future_dataframe(periods=365)
# Generate the forecast
forecast = m.predict(future) - # Plot the forecast
fig = m.plot(forecast)
fig2 = m.plot_components(forecast) - # Print the forecast data
print(forecast)

This article offers a fascinating perspective on the subject. The depth of research and clarity in presentation make it a valuable read for anyone interested in this topic. It’s refreshing to see such well-articulated insights that not only inform but also provoke thoughtful discussion. I particularly appreciated the way the author connected various aspects to provide a comprehensive understanding. It’s clear that a lot of effort went into compiling this piece, and it certainly pays off. Looking forward to reading more from this author and hearing other readers’ thoughts. Keep up the excellent work!