Taming Time Series Data Using Deep Neural Networks

With the advent of the Internet of Things, more and more devices are being added to the World Wide Web every day. Today's world is rapidly becoming inundated with intelligence devices. These devices are producing data at a rapid pace which we have never seen before. The storage cost has significantly come down, allowing companies to store this massive data in a cheap manner. Smart City projects have been kick-started by various governments. These Smart City projects rely heavily on this instrumentation. Technology companies and governments now want to leverage this massive data, generated from these smart devices, to perform analytics and produce data-enabled applications. The end use cases of these analytics are limitless. The data is characterized by three factors: 

  • Volume: The amount of data generated
  • Variety: The different types of data 
  • Velocity: The speed at which this data is generated

Among all the different varieties of data, data from sensors is the most widespread and is referred to as time series data.

A time series is a series of data points indexed (or listed or graphed) in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data.  

Time series data is not a new type of data. For decades, financial industries have been using this data for various market-related purposes. Algorithmic trading is the use of computer programs to generate and follow a defined set of instructions to trade in the market. This allows profit to be generated at a greater speed and frequency compared to a human trader. Algorithmic trading leverages time series data. The traditional approach to time series data involves analyzing it in frequency domains or temporal domains. Today, deep learning has opened up a whole new door to analyzing time series data at a never before seen speed and level of precision.

Time series data is not just limited to sensor data and financial data. In many other real-world applications, such as speech recognition, machine translation, and sequence generation, data is captured in a temporal fashion. Two points in a time series may look identical, but they may have different temporal dependencies, thus making them belong to two different categories.

Deep learning allows us to build sophisticated models, which can capture non-linear relationships in the data in a much more efficient and faster manner. Deep learning can be defined in two ways.

Any neural network with more than three hidden layers can be defined as a deep learning network. Different layers in the network capture different properties of the data. The nature of deep learning is very valuable to time series analysis.

The other definition is the series of hacks performed on these networks to incorporate bagging and boosting functionalities, thus allowing us to build an ensemble of models through a single network. Once again, each model in the ensemble is now capable of understanding different regions of the data. This is very useful for analyzing time series data.

The aim of this chapter is to introduce MXNet R to our readers and show them how fully connected deep networks can be effective in predicting time series data. Our treatment of traditional time series data analysis will be very limited. We will provide sufficient references for traditional time series analysis.

In this chapter, we will do the following:

  • Introduce time series data and traditional approaches to solve them
  • Provide an overview of deep neural networks
  • Introduce the MXNet R package
  • Go over time series use cases and data
  • Build a deep learning solution for our time series problem

The code for this chapter was written in RStudio version 0.99.491. It uses R version 3.3.1. As we work through our example, we will introduce the MXNet R package that we will be using. During our code descriptions, we will be using some of the output printed in the console. We have included what was printed in the console immediately following the statement that prints the information to the console, to not disturb the flow of the code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset