Book Image

Forecasting Time Series Data with Facebook Prophet

By : Greg Rafferty
Book Image

Forecasting Time Series Data with Facebook Prophet

By: Greg Rafferty

Overview of this book

Prophet enables Python and R developers to build scalable time series forecasts. This book will help you to implement Prophet’s cutting-edge forecasting techniques to model future data with higher accuracy and with very few lines of code. You will begin by exploring the evolution of time series forecasting, from the basic early models to the advanced models of the present day. The book will demonstrate how to install and set up Prophet on your machine and build your first model with only a few lines of code. You'll then cover advanced features such as visualizing your forecasts, adding holidays, seasonality, and trend changepoints, handling outliers, and more, along with understanding why and how to modify each of the default parameters. Later chapters will show you how to optimize more complicated models with hyperparameter tuning and by adding additional regressors to the model. Finally, you'll learn how to run diagnostics to evaluate the performance of your models and see some useful features when running Prophet in production environments. By the end of this Prophet book, you will be able to take a raw time series dataset and build advanced and accurate forecast models with concise, understandable, and repeatable code.
Table of Contents (18 chapters)
1
Section 1: Getting Started
4
Section 2: Seasonality, Tuning, and Advanced Features
13
Section 3: Diagnostics and Evaluation

What this book covers

Chapter 1, The History and Development of Time Series Forecasting, will teach you about the earliest efforts to understand time series data and the main algorithmic developments up to the present day.

Chapter 2, Getting Started with Facebook Prophet, will walk you through the process of getting Prophet running on your machine, and then will test your installation by building your first model.

Chapter 3, Non-Daily Data, will cover how to modify the approach taken in the previous chapter in order to handle data that is recorded on a scale other than daily, so that you will be set up to work through all of the examples in later chapters.

Chapter 4, Seasonality, will discuss all of the ways to control seasonality in Prophet. Seasonality is one of the building blocks of Prophet models and contains the most control parameters, so this chapter is the longest but also one of the most important.

Chapter 5, Holidays, will teach you how to add the effect of holidays to your forecast. You will learn how to include a basic set of default holidays, how to change that set for different regions, how to add your own custom holidays, and how to control the strength of the effect.

Chapter 6, Growth Modes, will describe the three growth modes a trend line in Prophet can follow: linear, logistic, and flat. You will learn which scenarios to apply these modes to and observe what effect they have on your future forecasts.

Chapter 7, Trend Changepoints, will talk about how to control the rigidity of your final model. You will learn how to make a flexible model that can change direction often, or a rigid model that follows a constant line, why you may choose one or the other, and the effect this has on the uncertainty of your model with future data.

Chapter 8, Additional Regressors, will teach you how to include additional columns of data in your model. Similar to multi-variate regression, Prophet is able to combine multiple input vectors in a predictive forecast.

Chapter 9, Outliers and Special Events, will show you the two types of problems that outliers can cause in a Prophet model and will teach you several automated techniques for identifying outliers and how to handle them with Prophet.

Chapter 10, Uncertainty Intervals, will cover how to quantify the uncertainty in your model using different statistical methods, what the benefits and drawbacks of each method are, and how to visualize the amount of risk in your model.

Chapter 11, Cross-Validation, will teach you how to perform cross-validation in Prophet. You may already be familiar with cross-validation techniques in machine learning, but with time series data a different approach is needed. This chapter will teach you that approach and how to implement it in Prophet.

Chapter 12, Performance Metrics, will build upon the previous chapter and introduce the performance metrics Prophet features. You will learn how to combine cross validation with your chosen metric of performance to perform a grid search and optimize your model to gain the highest predictive accuracy.

Chapter 13, Productionalizing Prophet, is the final chapter and will teach you some additional techniques that will come in handy when using Prophet in a production environment. You will learn how to save your models for later use, how to update models as new data comes in, and how to use Prophet's Plotly plot functions to build highly interactive charts suitable for sharing on a web-based dashboard.