Chapter 4: Introduction to Autoregressive and Automated Methods for Time Series Forecasting In this chapter, you discover a suite of autoregressive methods for time series forecasting that you can test on your forecasting problems. The different sections in this chapter are structured to give you just enough information on each method to get started with a working code example and to show you where to look to get more information on the method.We also look at automated machine learning for time series forecasting and how this method can help you with model selection and hyperparameter tuning tasks.
Chapter 5: Introduction to Neural Networks for Time Series Forecasting In this chapter, I discuss some of the practical reasons data scientists may still want to think about deep learning when they build time series forecasting solutions. I then introduce recurrent neural networks and show how you can implement a few types of recurrent neural networks on your time series forecasting problems.
Chapter 6: Model Deployment for Time Series Forecasting In this final chapter, I introduce Azure Machine Learning SDK for Python to build and run machine learning workflows. You will get an overview of some of the most important classes in the SDK and how you can use them to build, train, and deploy a machine learning model on Azure.Through machine learning model deployment, companies can begin to take full advantage of the predictive and intelligent models they build and, therefore, transform themselves into actual AI-driven businesses.Finally, I show how to build an end-to-end data pipeline architecture on Azure and provide deployment code that can be generalized for different time series forecasting solutions.
Reader Support for This Book
This book also features extensive sample code and tutorials using Python, along with its technical libraries, that readers can leverage to learn how to solve real-world time series problems.
Readers can access the sample code and notebooks at the following link: aka.ms/ML4TSFwithPython
As you work through the examples in this book, the project files you need are all available for download from aka.ms/ML4TSFwithPython
.
Each file contains sample notebooks and data that you can use to validate your knowledge, practice your technical skills, and build your own time series forecasting solutions.
How to Contact the Publisher
If you believe you've found a mistake in this book, please bring it to our attention. At John Wiley & Sons, we understand how important it is to provide our customers with accurate content, but even with our best efforts an error may occur.
In order to submit your possible errata, please email it to our customer service team at wileysupport@wiley.com
with the subject line “Possible Book Errata Submission.”
How to Contact the Author
We appreciate your input and questions about this book! You can find me on Twitter at @frlazzeri.
CHAPTER 1 Overview of Time Series Forecasting
Time series is a type of data that measures how things change over time. In a time series data set, the time column does not represent a variable per se: it is actually a primary structure that you can use to order your data set. This primary temporal structure makes time series problems more challenging as data scientists need to apply specific data preprocessing and feature engineering techniques to handle time series data.
However, it also represents a source of additional knowledge that data scientists can use to their advantage: you will learn how to leverage this temporal information to extrapolate insights from your time series data, like trends and seasonality information, to make your time series easier to model and to use it for future strategy and planning operations in several industries. From finance to manufacturing and health care, time series forecasting has always played a major role in unlocking business insights with respect to time.
Following are some examples of problems that time series forecasting can help you solve:
What are the expected sales volumes of thousands of food groups in different grocery stores next quarter?
What are the resale values of vehicles after leasing them out for three years?
What are passenger numbers for each major international airline route and for each class of passenger?
What is the future electricity load in an energy supply chain infrastructure, so that suppliers can ensure efficiency and prevent energy waste and theft?
The plot in Figure 1.1illustrates an example of time series forecasting applied to the energy load use case.
Figure 1.1 :Example of time series forecasting applied to the energy load use case
This first chapter of the book is dedicated to the conceptual introduction—with some practical examples—of time series, where you can learn the essential aspects of time series representations, modeling, and forecasting.
Specifically, we will discuss the following:
Flavors of Machine Learning for Time Series Forecasting – In this section, you will learn a few standard definitions of important concepts, such as time series, time series analysis, and time series forecasting, and discover why time series forecasting is a fundamental cross-industry research area.
Supervised Learning for Time Series Forecasting – Why would you want to reframe a time series forecasting problem as a supervised learning problem? In this section you will learn how to reshape your forecasting scenario as a supervised learning problem and, as a consequence, get access to a large portfolio of linear and nonlinear machine learning algorithms.
Python for Time Series Forecasting – In this section we will look at different Python libraries for time series data and how libraries such as pandas, statsmodels, and scikit-learn can help you with data handling, time series modeling, and machine learning, respectively.
Experimental Setup for Time Series Forecasting – This section will provide you general advice for setting up your Python environment for time series forecasting.
Let's get started and learn some important elements that we must consider when describing and modeling a time series.
Flavors of Machine Learning for Time Series Forecasting
In this first section of Chapter 1, we will discover together why time series forecasting is a fundamental cross-industry research area. Moreover, you will learn a few important concepts to deal with time series data, perform time series analysis, and build your time series forecasting solutions.
One example of the use of time series forecasting solutions would be the simple extrapolation of a past trend in predicting next week hourly temperatures. Another example would be the development of a complex linear stochastic model for predicting the movement of short-term interest rates. Time-series models have been also used to forecast the demand for airline capacity, seasonal energy demand, and future online sales.
In time series forecasting, data scientists' assumption is that there is no causality that affects the variable we are trying to forecast. Instead, they analyze the historical values of a time series data set in order to understand and predict their future values. The method used to produce a time series forecasting model may involve the use of a simple deterministic model, such as a linear extrapolation, or the use of more complex deep learning approaches.
Читать дальше