Skip to Content
Practical Time Series Analysis
book

Practical Time Series Analysis

by PKS Prakash, Avishek Pal
September 2017
Beginner
244 pages
5h 20m
English
Packt Publishing
Content preview from Practical Time Series Analysis

1D convolution for time series forecasting

We will continue to use the air pollution dataset to demonstrate 1D convolution for time series forecasting. The shape of input to the convolution layer is (number of samples, number of timesteps, number of features per timestep). In this case, number of timesteps is seven and number of feature per timestep is one as we are concerned about only air pressure, which is univariate. To develop a convolutional neural network, we need to import three new classes:

from keras.layers.convolutional import ZeroPadding1D 
from keras.layers.convolutional import Conv1D 
from keras.layers.pooling import AveragePooling1D 

A ZeroPadding1D layer is added after the input layer to add zeros at the beginning and end of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Time Series Analysis

Practical Time Series Analysis

Aileen Nielsen

Publisher Resources

ISBN: 9781788290227Supplemental Content