Machine Learning for Time-Series with Python

Book description

Get better insights from time-series data and become proficient in model performance analysis

Key Features

  • Explore popular and modern machine learning methods including the latest online and deep learning algorithms
  • Learn to increase the accuracy of your predictions by matching the right model with the right problem
  • Master time series via real-world case studies on operations management, digital marketing, finance, and healthcare

Book Description

The Python time-series ecosystem is huge and often quite hard to get a good grasp on, especially for time-series since there are so many new libraries and new models. This book aims to deepen your understanding of time series by providing a comprehensive overview of popular Python time-series packages and help you build better predictive systems.

Machine Learning for Time-Series with Python starts by re-introducing the basics of time series and then builds your understanding of traditional autoregressive models as well as modern non-parametric models. By observing practical examples and the theory behind them, you will become confident with loading time-series datasets from any source, deep learning models like recurrent neural networks and causal convolutional network models, and gradient boosting with feature engineering.

This book will also guide you in matching the right model to the right problem by explaining the theory behind several useful models. You'll also have a look at real-world case studies covering weather, traffic, biking, and stock market data.

By the end of this book, you should feel at home with effectively analyzing and applying machine learning methods to time-series.

What you will learn

  • Understand the main classes of time series and learn how to detect outliers and patterns
  • Choose the right method to solve time-series problems
  • Characterize seasonal and correlation patterns through autocorrelation and statistical techniques
  • Get to grips with time-series data visualization
  • Understand classical time-series models like ARMA and ARIMA
  • Implement deep learning models, like Gaussian processes, transformers, and state-of-the-art machine learning models
  • Become familiar with many libraries like Prophet, XGboost, and TensorFlow

Who this book is for

This book is ideal for data analysts, data scientists, and Python developers who want instantly useful and practical recipes to implement today, and a comprehensive reference book for tomorrow. Basic knowledge of the Python Programming language is a must, while familiarity with statistics will help you get the most out of this book.

Table of contents

  1. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Get in touch
  2. Introduction to Time-Series with Python
    1. What Is a Time-Series?
      1. Characteristics of Time-Series
    2. Time-Series and Forecasting – Past and Present
      1. Demography
      2. Genetics
      3. Astronomy
      4. Economics
      5. Meteorology
      6. Medicine
      7. Applied Statistics
    3. Python for Time-Series
      1. Installing libraries
      2. Jupyter Notebook and JupyterLab
      3. NumPy
      4. pandas
      5. Best practice in Python
    4. Summary
  3. Time-Series Analysis with Python
    1. What is time-series analysis?
    2. Working with time-series in Python
      1. Requirements
      2. Datetime
      3. pandas
    3. Understanding the variables
    4. Uncovering relationships between variables
    5. Identifying trend and seasonality
    6. Summary
  4. Preprocessing Time-Series
    1. What Is Preprocessing?
    2. Feature Transforms
      1. Scaling
      2. Log and Power Transformations
      3. Imputation
    3. Feature Engineering
      1. Date- and Time-Related Features
      2. ROCKET
      3. Shapelets
    4. Python Practice
      1. Log and Power Transformations in Practice
      2. Imputation
      3. Holiday Features
      4. Date Annotation
      5. Paydays
      6. Seasons
      7. The Sun and Moon
      8. Business Days
      9. Automated Feature Extraction
      10. ROCKET
      11. Shapelets in Practice
    5. Summary
  5. Introduction to Machine Learning for Time-Series
    1. Machine learning with time-series
      1. Supervised, unsupervised, and reinforcement learning
      2. History of machine learning
    2. Machine learning workflow
      1. Cross-validation
      2. Error metrics for time-series
        1. Regression
        2. Classification
      3. Comparing time-series
    3. Machine learning algorithms for time-series
      1. Distance-based approaches
      2. Shapelets
      3. ROCKET
      4. Time-Series Forest and Canonical Interval Forest
      5. Symbolic approaches
      6. HIVE-COTE
      7. Discussion
      8. Implementations
    4. Summary
  6. Forecasting with Moving Averages and Autoregressive Models
    1. What are classical models?
      1. Moving average and autoregression
      2. Model selection and order
      3. Exponential smoothing
      4. ARCH and GARCH
      5. Vector autoregression
    2. Python libraries
      1. Statsmodels
    3. Python practice
      1. Requirements
      2. Modeling in Python
    4. Summary
  7. Unsupervised Methods for Time-Series
    1. Unsupervised methods for time-series
    2. Anomaly detection
      1. Microsoft
      2. Google
      3. Amazon
      4. Facebook
      5. Twitter
      6. Implementations
    3. Change point detection
    4. Clustering
    5. Python practice
      1. Requirements
      2. Anomaly detection
      3. Change point detection
    6. Summary
  8. Machine Learning Models for Time-Series
    1. More machine learning methods for time-series
      1. Validation
    2. K-nearest neighbors with dynamic time warping
    3. Silverkite
    4. Gradient boosting
    5. Python exercise
      1. Virtual environments
      2. K-nearest neighbors with dynamic time warping in Python
      3. Silverkite
      4. Gradient boosting
      5. Ensembles with Kats
    6. Summary
  9. Online Learning for Time-Series
    1. Online learning for time-series
      1. Online algorithms
    2. Drift
      1. Drift detection methods
    3. Adaptive learning methods
    4. Python practice
      1. Drift detection
      2. Regression
      3. Model selection
    5. Summary
  10. Probabilistic Models for Time-Series
    1. Probabilistic Models for Time-Series
    2. Prophet
    3. Markov Models
    4. Fuzzy Modeling
    5. Bayesian Structural Time-Series Models
    6. Python Exercise
      1. Prophet
      2. Markov Switching Model
      3. Fuzzy Time-Series
      4. Bayesian Structural Time-Series Modeling
    7. Summary
  11. Deep Learning for Time-Series
    1. Introduction to deep learning
    2. Deep learning for time-series
      1. Autoencoders
      2. InceptionTime
      3. DeepAR
      4. N-BEATS
      5. Recurrent neural networks
      6. ConvNets
      7. Transformer architectures
      8. Informer
    3. Python practice
      1. Fully connected network
      2. Recurrent neural network
      3. Dilated causal convolutional neural network
    4. Summary
  12. Reinforcement Learning for Time-Series
    1. Introduction to reinforcement learning
    2. Reinforcement Learning for Time-Series
    3. Bandit algorithms
    4. Deep Q-Learning
    5. Python Practice
      1. Recommendations
      2. Trading with DQN
    6. Summary
  13. Multivariate Forecasting
    1. Forecasting a Multivariate Time-Series
      1. Python practice
    2. What's next for time-series?
  14. Other Books You May Enjoy
  15. Index

Product information

  • Title: Machine Learning for Time-Series with Python
  • Author(s): Ben Auffarth
  • Release date: October 2021
  • Publisher(s): Packt Publishing
  • ISBN: 9781801819626