Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Forecasting Time Series Data with Prophet
Forecasting Time Series Data with Prophet

Forecasting Time Series Data with Prophet: Build, improve, and optimize time series forecasting models using Meta's advanced forecasting tool , Second Edition

Arrow left icon
Profile Icon Greg Rafferty
Arrow right icon
Mex$922.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9 (9 Ratings)
Paperback Mar 2023 282 pages 2nd Edition
eBook
Mex$179.99 Mex$738.99
Paperback
Mex$922.99
Subscription
Free Trial
Arrow left icon
Profile Icon Greg Rafferty
Arrow right icon
Mex$922.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9 (9 Ratings)
Paperback Mar 2023 282 pages 2nd Edition
eBook
Mex$179.99 Mex$738.99
Paperback
Mex$922.99
Subscription
Free Trial
eBook
Mex$179.99 Mex$738.99
Paperback
Mex$922.99
Subscription
Free Trial

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Colour book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Forecasting Time Series Data with Prophet

The History and Development of Time Series Forecasting

Prophet is a powerful tool for creating, visualizing, and optimizing your forecasts! With Prophet, you’ll be able to understand what factors will drive your future results, which will enable you to make more confident decisions. You accomplish these tasks and goals through an intuitive but very flexible programming interface that is designed for both the beginner and expert alike.

You don’t need a deep knowledge of the math or statistics behind time series forecasting techniques to leverage the power of Prophet, although if you do possess this knowledge, Prophet includes a rich feature set that allows you to deploy your experience to great effect. You’ll be working in a structured paradigm where each problem follows the same pattern, allowing you to spend less time figuring out how to optimize your forecasts and more time discovering key insights to supercharge your decisions.

This chapter introduces the foundational ideas behind time series forecasting and discusses some of the key model iterations that eventually led to the development of Prophet. In this chapter, you’ll learn what time series data is and why it must be handled differently than non-time series data, and then you’ll discover the most powerful innovations, of which Prophet is one of the latest. Specifically, we will cover the following topics:

  • Understanding time series forecasting
  • Moving averages and exponential smoothing
  • ARIMA
  • ARCH/GARCH
  • Neural networks
  • Prophet
  • Recent developments

Understanding time series forecasting

A time series is a set of data collected sequentially over time. For example, think of any chart where the x axis is some measurement of time—anything from the number of stars in the universe since the Big Bang until today or the amount of energy released each nanosecond from a nuclear reaction. The data behind both is time series. The chart in the weather app on your phone showing the expected temperature for the next 7 days? That’s also the plot of a time series.

In this book, we are mostly concerned with events on the human scales of years, months, days, and hours, but all of this is time series data. Predicting future values is the act of forecasting.

Forecasting the weather has obviously been important to humans for millennia, particularly since the advent of agriculture. In fact, over 2,300 years ago, the Greek philosopher Aristotle wrote a treatise called Meteorology that contained a discussion of early weather forecasting. The very word forecast was coined by an English meteorologist in the 1850s, Robert FitzRoy, who achieved fame as the captain of the HMS Beagle during Charles Darwin’s pioneering voyage.

However, time series data is not unique to weather. The field of medicine adopted time series analysis techniques with the 1901 invention of the first practical electrocardiogram (ECG) by the Dutch physician Willem Einthoven. The ECG produces the familiar pattern of heartbeats we now see on the machine next to a patient’s bed in every medical drama.

Today, one of the most discussed fields of forecasting is economics. There are entire television channels dedicated to analyzing trends in the stock market. Governments use economic forecasting to advise central bank policy, politicians use economic forecasting to develop their platforms, and business leaders use economic forecasting to guide their decisions.

In this book, we will be forecasting topics as varied as carbon dioxide levels in the atmosphere, the number of riders on Chicago’s public bike share program, the growth of the wolf population in Yellowstone, the solar sunspot cycles, local rainfall, and even Instagram likes on some popular accounts.

The problem with dependent data

So, why does time series forecasting require its own unique approach? From a statistical perspective, you might see a scatter plot of time series with a relatively clear trend and attempt to fit a line using standard regression—the technique for fitting a straight line to data. The problem is that this violates the assumption of independence that linear regression demands.

To illustrate time series dependence with an example, let’s say that a gambler is rolling an unbiased die. I tell you that they just rolled a 2 and ask what the next value will be. This data is independent; previous rolls have no effect on future rolls, so knowing that the previous roll was a 2 does not provide any information about the next roll.

However, in a different situation, let’s say that I call you from an undisclosed location somewhere on Earth and ask you to guess the temperature at my location. Your best bet would be to guess some average global temperature for that day. Now, imagine that I tell you that yesterday’s temperature at my location was 90°F. That provides a great deal of information to you because you intuitively know that yesterday’s temperature and today’s temperature are linked in some way; they are not independent.

With time series data, you cannot randomly shuffle the order of data without disturbing the trends, within a reasonable margin of error. The order of the data matters; it is not independent. When data is dependent like this, a regression model can show statistical significance by random chance, even when there is no true correlation, much more often than your chosen confidence level would suggest.

Because high values tend to follow high values and low values tend to follow low values, a time series dataset is more likely to show more clusters of high or low values than would otherwise be present, and this, in turn, can lead to the appearance of more correlations than would otherwise be present.

The website Spurious Correlations by Tyler Vigen specializes in pointing out examples of seemingly significant, but utterly ridiculous, time series correlations. Here is one example:

Figure 1.1 – A spurious time series correlation (https://www.tylervigen.com/spurious-correlations)

Figure 1.1 – A spurious time series correlation (https://www.tylervigen.com/spurious-correlations)

Obviously, the number of people who drown in pools each year is completely independent of the number of films Nicolas Cage appears in. They simply have no effect on each other at all. However, by making the fallacy of treating time series data as if it were independent, Vigen has shown that by pure random chance, the two series of data do, in fact, correlate significantly. These types of random chances are much more likely to happen when ignoring dependence in time series data.

Now that you understand what exactly time series data is and what sets it apart from other datasets, let’s look at a few milestones in the development of models, from the earliest models up to Prophet.

Moving averages and exponential smoothing

Possibly the simplest form of forecasting is the moving average (MA). Often, an MA is used as a smoothing technique to find a straighter line through data with a lot of variation. Each data point is adjusted to the value of the average of n surrounding data points, with n being referred to as the window size. With a window size of 10, for example, we would adjust a data point to be the average of the 5 values before and the 5 values after. In a forecasting setting, the future values are calculated as the average of the n previous values, so again, with a window size of 10, this means the average of the 10 previous values.

The balancing act with an MA is that you want a large window size in order to smooth out the noise and capture the actual trend, but with a larger window size, your forecasts are going to lag the trend significantly as you reach back further and further to calculate the average. The idea behind exponential smoothing is to apply exponentially decreasing weights to the values being averaged over time, giving recent values more weight and older values less weight. This allows the forecast to be more reactive to changes while still ignoring a good deal of noise.

As you can see in the following plot of simulated data, the MA line exhibits much rougher behavior than the exponential smoothing line, but both lines still adjust to trend changes at the same time:

Figure 1.2 – MA versus exponential smoothing

Figure 1.2 – MA versus exponential smoothing

Exponential smoothing originated in the 1950s with simple exponential smoothing, which does not allow for trends or seasonality. Charles Holt advanced the technique in 1957 to allow for a trend with what he called double exponential smoothing; and in collaboration with Peter Winters, Holt added seasonality support in 1960, in what is commonly called Holt-Winters exponential smoothing.

The downside to these methods of forecasting is that they can be slow to adjust to new trends and so forecasted values lag behind reality—they do not hold up well to longer forecasting timeframes, and there are many hyperparameters to tune, which can be a difficult and very time-consuming process.

ARIMA

In 1970, the mathematicians George Box and Gwilym Jenkins published Time Series: Forecasting and Control, which described what is now known as the Box-Jenkins model. This methodology took the idea of the MA further with the development of ARIMA. As a term, ARIMA is often used interchangeably with Box-Jenkins, although technically, Box-Jenkins refers to a method of parameter optimization for an ARIMA model.

ARIMA is an acronym that refers to three concepts: Autoregressive (AR), Integrated (I), and MA. We already understand the MA part. AR means that the model uses the dependent relationship between a data point and a certain number of lagged data points. That is, the model predicts upcoming values based on previous values. This is similar to predicting that it will be warm tomorrow because it’s been warm all week so far.

The integrated part means that instead of using any raw data point, the difference between that data point and a previous data point is used. Essentially, this means that we convert a series of values into a series of changes in values. Intuitively, this suggests that tomorrow will be more or less the same temperature as today because the temperature all week hasn’t varied too much.

Each of the AR, I, and MA components of an ARIMA model are explicitly specified as a parameter in the model. Traditionally, p is used for the number of lag observations to use, also known as the lag order. The number of times that a raw observation is differenced, or the degree of differencing, is known as d, and q represents the size of the MA window. Thus arises the standard notation for an ARIMA model of ARIMA(p, d, q), where p, d, and q are all non-negative integers.

A problem with ARIMA models is that they do not support seasonality, or data with repeating cycles, such as temperature rising in the day and falling at night or rising in summer and falling in winter. Seasonal ARIMA (SARIMA) was developed to overcome this drawback. Similar to the ARIMA notation, the notation for a SARIMA model is SARIMA(p, d, q)(P, D, Q)m, with P being the seasonal AR order, D the seasonal difference order, Q the seasonal MA order, and m the number of time steps for a single seasonal period.

You may also come across other variations of ARIMA models, including Vector ARIMA (VARIMA) for cases with multiple time series as vectors; Fractional ARIMA (FARIMA) or Autoregressive Fractionally Integrated Moving Average

PD: Style as P-Keyword (ARFIMA), both of which include a fractional differencing degree, allowing for long memory in the sense that observations far apart in time can have non-negligible dependencies; and SARIMAX, a seasonal ARIMA model where the X stands for exogenous or additional variables added to the model, such as adding a rain forecast to a temperature model.

ARIMA does typically exhibit very good results, but the downside is its complexity. Tuning and optimizing ARIMA models is often computationally expensive and successful results can depend upon the skill and experience of the forecaster. It is not a scalable process, but better suited to ad hoc analyses by skilled practitioners.

ARCH/GARCH

When the variance of a dataset is not constant over time, ARIMA models face problems with modeling it. In economics and finance, in particular, this is common. In a financial time series, large returns tend to be followed by large returns and small returns tend to be followed by small returns. The former is called high volatility, and the latter is low volatility.

Autoregressive Conditional Heteroscedasticity (ARCH) models were developed to solve this problem. Heteroscedasticity is a fancy way of saying that the variance or spread of the data is not constant throughout, with the opposite term being homoscedasticity. The difference is visualized here:

Figure 1.3 – Scedasticity

Figure 1.3 – Scedasticity

Robert Engle introduced the first ARCH model in 1982 by describing conditional variance as a function of previous values. For example, there is a lot more uncertainty about daytime electricity usage than there is about nighttime usage. In a model of electricity usage, then, we might assume that the daytime hours have a particular variance, and usage during the night would have a lower variance.

Tim Bollerslev and Stephen Taylor introduced a moving average component to the model in 1986 with their Generalized ARCH (GARCH) model. In the electricity example, the variance in usage was a function of the time of day, but perhaps the swings in volatility don’t necessarily occur at specific times of the day, and the swings themselves are random. This is when GARCH is useful.

Both ARCH and GARCH models can handle neither trend nor seasonality though, so often, in practice, an ARIMA model may be built first to extract out the seasonal variation and trend of a time series, and then an ARCH model may be used to model the expected variance.

Neural networks

A relatively recent development in time series forecasting is the use of Recurrent Neural Networks (RNNs). This was made possible with the development of the Long Short-Term Memory (LSTM) unit by Sepp Hochreiter and Jürgen Schmidhuber in 1997. Essentially, an LSTM unit allows a neural network to process a sequence of data, such as speech or video, instead of a single data point, such as an image.

A standard RNN is called recurrent because it has loops built into it, which is what gives it memory, that is, gives it access to previous information. A basic neural network can be trained to recognize an image of a pedestrian on a street by learning what a pedestrian looks like from previous images, but it cannot be trained to identify that a pedestrian in a video will soon be crossing the street based upon the pedestrian’s approach observed in previous frames of the video. It has no knowledge of the sequence of images that leads to the pedestrian stepping out into the road. Short-term memory is what the network needs temporarily to provide context, but that memory degrades quickly.

Early RNNs had a memory problem: it just wasn’t very long. In the sentence “airplanes fly in the …,” a simple RNN may be able to guess the next word will be sky, but with “I went to France for vacation last summer. That’s why I spent my spring learning to speak …,” it’s not so easy for the RNN to guess that French comes next; it understands that the word for a language should come next but has forgotten that the phrase started by mentioning France. An LSTM, though, has this necessary context. It gives the network’s short-term memory more longevity. In the case of time series data, where patterns can reoccur over long time scales, LSTMs can perform very well.

Time series forecasting with LSTMs is still in its infancy when compared to the other forecasting methods discussed here; however, it shows promise. One strong advantage over other forecasting techniques is the ability of neural networks to capture non-linear relationships, but as with any deep learning problem, LSTM forecasting requires a great deal of data and computing power and a long processing time.

Additionally, there are many decisions to be made regarding the architecture of the model and the hyperparameters to be used, which necessitate a very experienced forecaster. In most practical problems, where budget and deadlines must be considered, an ARIMA model is often the better choice.

Prophet

Prophet was developed internally at Facebook (now known as Meta) by Sean J. Taylor and Ben Letham in order to overcome two issues often encountered with other forecasting methodologies: the more automatic forecasting tools available tended to be too inflexible and unable to accommodate additional assumptions, and the more robust forecasting tools required an experienced analyst with specialized data science skills. Facebook experienced too much demand for high-quality business forecasts than their analysts were able to provide. In 2017, Facebook released Prophet to the public as open source software.

Prophet was designed to optimally handle business forecasting tasks, which typically feature any of these attributes:

  • Time series data captured at the hourly, daily, or weekly level with ideally at least a full year of historical data
  • Strong seasonality effects occurring daily, weekly, and/or yearly
  • Holidays and other special one-time events that don’t necessarily follow the seasonality patterns but occur irregularly
  • Missing data and outliers
  • Significant trend changes that may occur with the launch of new features or products, for example
  • Trends that asymptotically approach an upper or lower bound

Out of the box, Prophet typically produces very high-quality forecasts, but it is also very customizable and approachable for data analysts with no prior expertise in time series data. As you’ll see in later chapters, tuning a Prophet model is very intuitive.

Essentially, Prophet is an additive regression model. This means that the model is simply the sum of several (optional) components, such as the following:

  • A linear or logistic growth trend curve
  • An annual seasonality curve
  • A weekly seasonality curve
  • A daily seasonality curve
  • Holidays and other special events
  • Additional user-specified seasonality curves, such as hourly or quarterly, for example

To take a concrete example, let’s say we are modeling the sales of a small online retail store over 4 years, from January 1, 2000, to the end of 2003. We observe that the overall trend is constantly increasing over time from 1,000 sales per day to around 1,800 at the end of the time period. We also see that sales in spring are about 50 units above average and sales in autumn are about 50 units below average. Weekly, sales tend to be lowest on Tuesday and increase throughout the week, peaking on Saturday. Finally, throughout the hours of the day, sales peak at noon and smoothly fall to their lowest at midnight. This is what those individual curves would look like (note the different x-axis scales on each chart):

Figure 1.4 – Model components

Figure 1.4 – Model components

An additive model would take those four curves and simply add them to each other to arrive at the final model for sales throughout the years. The final curve gets more and more complex as the sub-components are added up:

Figure 1.5 – Additive model

Figure 1.5 – Additive model

This preceding plot displays just the first year to see the weekly and daily variations better, but the full curve extends for 4 years.

Under the hood, Prophet is written in Stan, a probabilistic programming language (see the home page at https://mc-stan.org/ for more information about Stan). This has several advantages. It allows Prophet to optimize the fit process so that it typically completes in under a second. Stan is also compatible with both Python and R, so the Prophet team is able to share the same core fitting procedure between both language implementations. Also, by using Bayesian statistics, Stan allows Prophet to create uncertainty intervals for future predictions to add a data-driven estimate of forecasting risk.

Prophet manages to achieve typical results just as well as more complicated forecasting techniques but with just a fraction of the effort. It has something for everyone. A beginner can build a highly accurate model in just a few lines of code without necessarily understanding the details of how everything works, while an expert can dig deep into the model, adding more features and tweaking hyperparameters to eke out incrementally better performance.

Recent developments

The public release of Prophet has inspired a lot of open source activity around forecasting packages. Although Prophet remains the most widely used tool, there are several competing packages to keep an eye on.

NeuralProphet

Prophet has become so popular due to its ease of learning, quick predictions from data, and customizability. However, it does have some shortcomings; the key one among these is that it is a linear model. As discussed earlier in this chapter, neural networks are often used when forecasting tasks require a non-linear model, although an analyst must be very knowledgeable about both time series and applied machine learning to apply these models effectively. NeuralProphet (https://github.com/ourownstory/neural_prophet) aims to bridge this gap and allows an analyst with expertise only in time series to build a very strong neural model.

Oskar Triebe at Stanford University has built and optimized NeuralProphet for several years with the help of the open source community, but at the time of writing, NeuralProphet is still in the beta phase. It switches out Prophet’s dependency on the Stan language with PyTorch, thus enabling deep learning methods. NeuralProphet models time series autocorrelation with an Autoregressive Network (AR-Net) and models lagged regressors with a Feed-Forward Neural Network. The programming interface has been designed to be nearly identical to Prophet’s, so learning how to build models in NeuralProphet will be quite familiar to anyone already familiar with Prophet.

Google’s “robust time series forecasting at scale”

Not to be outdone, in April 2017, just 2 months after Facebook announced Prophet was being made open source, Google described their solution to the forecasting problem in their blog post Our quest for a robust time series forecasting at scale (https://www.unofficialgoogledatascience.com/2017/04/our-quest-for-robust-time-series.html). Unlike Prophet, Google’s package is not open source, so few details are publicly available. A key difference between Prophet’s and Google’s approaches is that Google’s forecasting package uses an ensemble method to forecast growth trends. In the time series context, this means that Google fits multiple forecast models, removes any outliers, and takes the weighted average of each individual model to arrive at a final model. At the time of writing, Google has not announced any plans to release its forecasting package to the open source community.

LinkedIn’s Silverkite/Greykite

Compared to Facebook and Google, LinkedIn is a relative newcomer to the open source forecasting community. In May 2021, LinkedIn announced their Greykite forecasting library for Python (https://github.com/linkedin/greykite), which uses their own Silverkite algorithm (the Prophet algorithms are also options within Greykite’s modeling framework). Greykite was developed to provide some key benefits to forecasting at LinkedIn: the solution must flexible, intuitive, and fast. If that sounds familiar, it’s because those are the very same qualities Facebook targeted when developing Prophet.

Whereas Prophet uses a Bayesian approach to fit a model, Silverkite uses more traditional models such as a ridge, elastic net, and boosted trees. Both Prophet and Silverkite can model linear growth, but only Silverkite can handle square root and quadratic growth. Prophet, however, can model logistic growth, something that Silverkite cannot do. Possibly the most exciting aspect of Silverkite from an analyst’s point of view is that domain expertise can easily be added to a model via external variables. Silverkite uses sklearn for its API, so any user familiar with that library should have no trouble ramping up with Silverkite.

Uber’s Orbit

At the same time that LinkedIn announced the Greykite library, Uber announced their own forecasting package, Object-Oriented Bayesian Time Series (Orbit) (https://github.com/uber/orbit). As the name suggests, Orbit is Bayesian just like Prophet. Orbit, however, was designed to be more generalizable than Prophet, bridging the gap between typical business problems and more complex statistical solutions.

Although Uber’s benchmarking indicates that Orbit performs well on all types of forecasting problems, its bread-and-butter use case is in marketing mix models, a technique to quantify the impact of several marketing inputs on sales. Orbit was implemented with two main types of Bayesian structural time series: Local Global Trend (LGT) and Damped Local Trend (DLT) models. Uber claims this approach shows competitive results compared to other models, including Prophet, with improved metrics ranging from 12% to 60%. Like Greykite, Orbit uses the sklearn paradigm to help new users onboard.

Summary

Through this brief survey of time series, you learned why time series data can be problematic if not analyzed with specialized techniques. You followed the developments of mathematicians and statisticians as they created new techniques to achieve higher forecasting accuracy or greater ease of use. You also learned what motivated the Prophet team to add their own contributions to this legacy and what decisions they made in their approach, and you learned how the open source community has reacted and begun work on different approaches.

In the next chapter, you’ll learn how to get Prophet running on your machine and build your first model. By the end of this book, you’ll understand every feature, no matter how small, and have them all in your toolbox to supercharge your own forecasts.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore Prophet, the open source forecasting tool developed at Meta, to improve your forecasts
  • Create a forecast and run diagnostics to understand forecast quality
  • Fine-tune models to achieve high performance and report this performance with concrete statistics

Description

Forecasting Time Series Data with Prophet will help you to implement Prophet's cutting-edge forecasting techniques to model future data with high accuracy using only a few lines of code. This second edition has been fully revised with every update to the Prophet package since the first edition was published two years ago. An entirely new chapter is also included, diving into the mathematical equations behind Prophet's models. Additionally, the book contains new sections on forecasting during shocks such as COVID, creating custom trend modes from scratch, and a discussion of recent developments in the open-source forecasting community. You'll cover advanced features such as visualizing forecasts, adding holidays and trend changepoints, and handling outliers. You'll use the Fourier series to model seasonality, learn how to choose between an additive and multiplicative model, and understand when to modify each model parameter. Later, you'll see 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 in production. By the end of this book, you'll be able to take a raw time series dataset and build advanced and accurate forecasting models with concise, understandable, and repeatable code.

Who is this book for?

This book is for business managers, data scientists, data analysts, machine learning engineers, and software engineers who want to build time-series forecasts in Python or R. To get the most out of this book, you should have a basic understanding of time series data and be able to differentiate it from other types of data. Basic knowledge of forecasting techniques is a plus.

What you will learn

  • Understand the mathematics behind Prophet's models
  • Build practical forecasting models from real datasets using Python
  • Understand the different modes of growth that time series often exhibit
  • Discover how to identify and deal with outliers in time series data
  • Find out how to control uncertainty intervals to provide percent confidence in your forecasts
  • Productionalize your Prophet models to scale your work faster and more efficiently
Estimated delivery fee Deliver to Mexico

Standard delivery 10 - 13 business days

Mex$149.95

Premium delivery 3 - 6 business days

Mex$299.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 31, 2023
Length: 282 pages
Edition : 2nd
Language : English
ISBN-13 : 9781837630417
Category :
Languages :
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Colour book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Mexico

Standard delivery 10 - 13 business days

Mex$149.95

Premium delivery 3 - 6 business days

Mex$299.95
(Includes tracking information)

Product Details

Publication date : Mar 31, 2023
Length: 282 pages
Edition : 2nd
Language : English
ISBN-13 : 9781837630417
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Mex$ 2,830.97
Modern Time Series Forecasting with Python
Mex$1086.99
Forecasting Time Series Data with Prophet
Mex$922.99
Causal Inference and Discovery in Python
Mex$820.99
Total Mex$ 2,830.97 Stars icon
Banner background image

Table of Contents

19 Chapters
Part 1: Getting Started with Prophet Chevron down icon Chevron up icon
Chapter 1: The History and Development of Time Series Forecasting Chevron down icon Chevron up icon
Chapter 2: Getting Started with Prophet Chevron down icon Chevron up icon
Chapter 3: How Prophet Works Chevron down icon Chevron up icon
Part 2: Seasonality, Tuning, and Advanced Features Chevron down icon Chevron up icon
Chapter 4: Handling Non-Daily Data Chevron down icon Chevron up icon
Chapter 5: Working with Seasonality Chevron down icon Chevron up icon
Chapter 6: Forecasting Holiday Effects Chevron down icon Chevron up icon
Chapter 7: Controlling Growth Modes Chevron down icon Chevron up icon
Chapter 8: Influencing Trend Changepoints Chevron down icon Chevron up icon
Chapter 9: Including Additional Regressors Chevron down icon Chevron up icon
Chapter 10: Accounting for Outliers and Special Events Chevron down icon Chevron up icon
Chapter 11: Managing Uncertainty Intervals Chevron down icon Chevron up icon
Part 3: Diagnostics and Evaluation Chevron down icon Chevron up icon
Chapter 12: Performing Cross-Validation Chevron down icon Chevron up icon
Chapter 13: Evaluating Performance Metrics Chevron down icon Chevron up icon
Chapter 14: Productionalizing Prophet Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9
(9 Ratings)
5 star 88.9%
4 star 11.1%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Tomek Dec 18, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Brilliant textbook: well structured, clear with interesitng and practical casestudies.
Subscriber review Packt
Dror May 07, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Time series forecasting - making predictions based on historical data - is an important field of statistics and machine learning (ML). In 2017, Facebook (now Meta) released Prophet, an open-source forecasting tool in Python and R, which quickly become one of the most powerful libraries for time series forecasting.This book is a unique and comprehensive guide to time series forecasting using Prophet. To get the most out of it, readers are expected to have basic understanding of time series data, and preferably some familiarity with Python's pandas and Matplotlib libraries. While the examples in the book are written in Python, R users will also benefit from the clear explanations in the book and should be able to easily port the code to R. The accompanying GitHub repo is well-organized and very helpful.This practical guide begins with an introduction to Prophet, including the principles behind it and its installation and usage. It then gradually progresses to discuss various important topics in time series forecasting, such as dealing with seasonality, controlling growth modes, and dealing with outliers. The last part of the book focuses on diagnostics and evaluation techniques, as well as on productionalizing Prophet.This book is a wonderful, up-to-date resource for researchers, data scientists, software engineers and technical business managers interested in building time series forecasting models in Python or R. Highly recommended!
Amazon Verified review Amazon
Amazon Customer May 20, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Forecasting time series data with prophet is a great book for data scientists and machine learning engineers to do forecasting at scale.It starts with the fundamental of time series forecasting and explains how we can build the forecasting model using prophet package for different time buckets. Afterward it shows how the model could be decomposed to its components and how each component is contribute to forecast.What I like the most is how we can add additional regressor to forecast model and interpret them. At the end the book shows how to creat a production version of the model to be used at scale.
Amazon Verified review Amazon
Riff Raff May 03, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I’ve been looking for a book like this for years. Five stars!
Amazon Verified review Amazon
Yiqiao Yin Apr 08, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Prophet is a powerful tool that empowers Python and R developers to construct scalable time series predictions. This guidebook will equip you with the necessary knowledge to implement Prophet's state-of-the-art forecasting techniques and model future data with a higher degree of accuracy and with minimal lines of code.You'll embark on a journey to explore the evolution of time series forecasting, from the rudimentary early models to the cutting-edge models of the present era. The book will guide you through the process of installing and configuring Prophet on your computer and building your initial model using just a few lines of code. You'll also delve into more advanced features, such as visualizing your forecasts, adding holidays, seasonality, and trend changepoints, handling outliers, and more. Additionally, you'll gain an understanding of why and how to modify each of the default parameters.As you progress through the later chapters, you'll learn how to optimize more complex models with hyperparameter tuning and by incorporating additional regressors into the model. Finally, you'll discover how to run diagnostics to evaluate the performance of your models and take advantage of some useful features when utilizing Prophet in production environments. By the end of this comprehensive Prophet book, you'll be able to take a raw time series dataset and develop advanced and precise forecasting models using concise, comprehensible, and replicable code.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela