Book Image

Deep Learning for Time Series Cookbook

By : Vitor Cerqueira, Luís Roque
Book Image

Deep Learning for Time Series Cookbook

By: Vitor Cerqueira, Luís Roque

Overview of this book

Most organizations exhibit a time-dependent structure in their processes, including fields such as finance. By leveraging time series analysis and forecasting, these organizations can make informed decisions and optimize their performance. Accurate forecasts help reduce uncertainty and enable better planning of operations. Unlike traditional approaches to forecasting, deep learning can process large amounts of data and help derive complex patterns. Despite its increasing relevance, getting the most out of deep learning requires significant technical expertise. This book guides you through applying deep learning to time series data with the help of easy-to-follow code recipes. You’ll cover time series problems, such as forecasting, anomaly detection, and classification. This deep learning book will also show you how to solve these problems using different deep neural network architectures, including convolutional neural networks (CNNs) or transformers. As you progress, you’ll use PyTorch, a popular deep learning framework based on Python to build production-ready prediction solutions. By the end of this book, you'll have learned how to solve different time series tasks with deep learning using the PyTorch ecosystem.
Table of Contents (12 chapters)

Tackling TSC problems with sktime

In this recipe, we explore an alternative approach to PyTorch for TSC problems, which is sktime. sktime is a Python library devoted to time series modeling, which includes several neural network models for TSC.

Getting ready

You can install sktime using pip. You’ll also need the keras-self-attention library, which includes self-attention methods necessary for running some of the methods in sktime:

pip install 'sktime[dl]'
pip install keras-self-attention

The trailing dl tag in squared brackets when installing sktime means you want to include the optional deep learning models available in the library.

In this recipe, we’ll use an example dataset available in sktime. We’ll load it in the next section.

How to do it…

As the name implies, the sktime library follows a design pattern similar to scikit-learn. So, our approach to building a deep learning model using sktime will be similar to the workflow...