Book Image

Machine Learning for Time-Series with Python - Second Edition

By : Ben Auffarth
4 (4)
Book Image

Machine Learning for Time-Series with Python - Second Edition

4 (4)
By: Ben Auffarth

Overview of this book

The Python time-series ecosystem is a huge and challenging topic to tackle, especially for time series since there are so many new libraries and models. Machine Learning for Time Series, Second Edition, aims to deepen your understanding of time series by providing a comprehensive overview of popular Python time-series packages and helping you build better predictive systems. This fully updated second edition starts by re-introducing the basics of time series and then helps you get to grips with traditional autoregressive models as well as modern non-parametric models. By observing practical examples and the theory behind them, you will gain a deeper understanding of loading time-series datasets from any source and a variety of models, such as deep learning recurrent neural networks, causal convolutional network models, and gradient boosting with feature engineering. This book will also help you choose the right model for the right problem by explaining the theory behind several useful models. New updates include a chapter on forecasting and extracting signals on financial markets and case studies with relevant examples from operations management, digital marketing, and healthcare. By the end of this book, you should feel at home with effectively analyzing and applying machine learning methods to time series.
Table of Contents (3 chapters)

What are the technical problems associated with time series?

The three main machine learning problems with time series are forecasting, classification, regression, and anomaly detection. In this section, we'll provide a broad overview of applications of time series and a history of machine learning and analysis techniques applied to time series.Common problem scenarios when dealing with time series data include:

  • Forecasting: The use of a model to predict future values based on previously observed values. This technique is used to predict future values of the time series based on past values. This can be done using methods such as ARIMA or exponential smoothing.
  • Decomposition: This technique is used to separate the data into its constituent parts such as trend, seasonality, and residuals. This can be done using methods such as additive or multiplicative decomposition. This involves trend analysis, where we identify long-term trends in a time series, and seasonality analysis, which is about identifying repeating patterns in a time series.
  • Classification/Regression: This technique is used to predict a target variable based on the time series data. This can be done using methods such as support vector machines or logistic regression.
  • Anomaly detection: Identifying unusual patterns (outliers) in a time series. Outliers are unusual observations that fall outside of the typical pattern.
  • Clustering: This technique is used to group together similar time series. This can be done using methods such as k-means clustering.
  • Drift detection: This technique is used to identify systematic changes in the time series data. This can be done using methods such as the Mann-Kendall test.
  • Smoothing: This technique is used to remove the noise from the data. This can be done using a simple moving average or a more sophisticated technique such as exponential smoothing.

An example for forecasting is ARIMA modeling, where we are using autoregressive and moving average models to forecast future values in a time series. Which technique you use will depend on the nature of your data and the problem you are trying to solve.Multivariate forecasting is a natural extension of the univariate case, where the goal is to predict multiple variables simultaneously. For example, in a company, one might want to forecast sales, price, inventory, and production simultaneously. This can be done with a vector autoregression model, where each variable is predicted as a function of its own past values and the past values of the other variables. Multistep forecasting is a generalization of the univariate case, where the goal is to predict multiple steps into the future. For example, in a company, one might want to forecast sales for the next 6 months. This can be done with a vector autoregression model, where each variable is predicted as a function of its own past values and the past values of the other variables.