Learn Forecasting in 10 Easy Steps

How to forecast call volumes using Facebooks Prophet Model

Let’s start with some basics

  1. Sign in to Google Collab 
  2. Create a CSV file with your dataset (the best option is to use day level dataset with at least a years worth of data)
  3. Make sure you name the columns as Date & Volume (otherwise you would need to edit the code a bit in step 4)
  4. Let’s load your data into Google Collab (use the upload to session icon)
  5. You are now ready to forecast !

We will use Facebook’s Prophet algorithm to forecast call volumes (To read more about it click here)

  1. #install prophet forecast module
    ! pip install prophet
  2. # Load the necessary libraries
    from prophet import Prophet
    import pandas as pd
  3. # Load the time series data
    data = pd.read_csv(“/Forecast.csv”)
  4. # 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’})
  5. # Create the prophet model
    m = Prophet(changepoint_prior_scale=0.5, seasonality_mode=’multiplicative’)
  6. # Add seasonality to the prophet model
    m.add_seasonality(name=’weekly’, period=7, fourier_order=5)
  7. # Fit the model to the data
    m.fit(data_prophet)
  8. # 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)
  9. # Plot the forecast
    fig = m.plot(forecast)
    fig2 = m.plot_components(forecast)
  10. # Print the forecast data
    print(forecast)
Forecast Results
Forecast Results

2 thoughts on “Learn Forecasting in 10 Easy Steps”

  1. 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!

  2. Legendary Liont

    Great article! I found your perspective on this topic both enlightening and thought-provoking. The way you break down complex ideas into understandable insights is truly commendable. It’s interesting to see how these developments could shape our future. I’m particularly intrigued by your point about potential challenges and would love to dive deeper into that.

    For those who are interested in exploring this topic further, I recommend checking out this resource for more detailed information: comprehensive guide. It offers additional insights that complement what’s discussed here.

    Looking forward to hearing others’ thoughts and continuing this discussion. Thanks for sharing such valuable information!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top