Reader small image

You're reading from  Practical Time Series Analysis

Product typeBook
Published inSep 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781788290227
Edition1st Edition
Languages
Right arrow
Authors (2):
Avishek Pal
Avishek Pal
author image
Avishek Pal

Dr. Avishek Pal, PhD, is a software engineer, data scientist, author, and an avid Kaggler living in Hyderabad, India. He achieved his Bachelor of Technology degree in industrial engineering from the Indian Institute of Technology (IIT) Kharagpur and earned his doctorate in 2015 from University of Warwick, Coventry, United Kingdom. He started his career as a software engineer at IBM India developing middleware solutions for telecom clients. This was followed by stints at a start-up product development company followed by Ericsson, the global telecom giant. After doctoral studies, Avishek started his career in India as a lead machine learning engineer for a leading US-based investment company. He is currently working at Microsoft as a senior data scientist. Avishek has published several research papers in reputed international conferences and journals.
Read more about Avishek Pal

PKS Prakash
PKS Prakash
author image
PKS Prakash

Dr. PKS Prakash is a data scientist and author. He has spent the last 12 years in developing many data science solutions in several practical areas in healthcare, manufacturing, pharmaceuticals, and e-commerce. He currently works as the data science manager at ZS Associates. He is the co-founder of Warwick Analytics, a spin-off from University of Warwick, UK. Prakash has published articles widely in research areas of operational research and management, soft computing tools, and advanced algorithms in leading journals such as IEEE-Trans, EJOR, and IJPR, among others. He has edited an article on Intelligent Approaches to Complex Systems and contributed to books such as Evolutionary Computing in Advanced Manufacturing published by WILEY and Algorithms and Data Structures using R and R Deep Learning Cookbook, published by PACKT.
Read more about PKS Prakash

View More author details
Right arrow

Preface

This book is about an introduction to time series analysis using Python. We aim to give you a clear overview of the basic concepts of the discipline and describe useful techniques that would be applicable for commonly-found analytics use cases in the industry. With too many projects requiring trend analytics and forecasting based on past data, time series analysis is an important tool in the knowledge arsenal of any modern data scientist. This book will equip you with tools and techniques, which will let you confidently think through a problem and come up with its solution in time series forecasting.

Why Python? Python is rapidly becoming a first choice for data science projects across different industry sectors. Most state-of-the art machine learning and deep learning libraries have a Python API. As a result, many data scientists prefer Python to implement the entire project pipeline that consists of data wrangling, model building, and model validation. Besides, Python provides easy-to-use APIs to process, model, and visualize time series data. Additionally, Python has been a popular language for the development of backend for web applications and hence has an appeal to a wider base of software professionals.

Now, let's see what you can expect to learn from every chapter this book.

What this book covers

Chapter 1, Introduction to Time Series, starts with a discussion of the three different types of datasets—cross-section, time series, and panel. The transition from cross-sectional to time series and the added complexity of data analysis is discussed. Special mathematical properties that make time series data special are described. Several examples demonstrate how exploratory data analysis can be used to visualize these properties.

Chapter 2, Understanding Time Series Data, covers three topics, advanced preprocessing and visualization of time series data through resampling, group-by, and calculation of moving averages; stationarity and statistical hypothesis testing to detect stationarity in a time series; and various methods of time series decomposition for stationarizing a non-stationary time series.

Chapter 3, Exponential Smoothing based Methods, covers smoothing-based models using the Holt-Winters approach for first order to capture levels, second order to smoothen levels and trend, and higher order smoothing is illustrated, which captures level, trend, and seasonality within a time series dataset.

Chapter 4, Auto-Regressive Models, discusses autoregressive models for forecasting. The chapter covers a detailed implementation for moving average (MA), autoregressive (AR), Auto Regressive Moving Average (ARMA), and Auto Regressive Integrated Moving Average (ARIMA) to capture different levels of nuisance within time series data during forecasting.

Chapter 5, Deep Learning for Time Series Forecasting, discusses recent deep learning algorithms that can be directly adapted to develop forecasting models for time series data. Recurrent Neural Networks (RNNs) are a natural choice for modeling sequence in data. In this chapter, different RNNs such as Vanilla RNN, Gated Recurrent Units, and Long Short Term Memory units are described to develop forecasting models on time series data. The mathematical formulations involved in developing these RNNs are conceptually discussed. Case studies are solved using the ‘keras’ deep learning library of Python.

Appendix, Getting Started with Python, you will find a quick and easy introduction to Python. If you are new to Python or looking for how to get started with the programming language, reading this appendix will help you get through the initial hurdles.

What you need for this book

You will need the Anaconda Python Distribution to run the examples in this book and write your own Python programs for time series analysis. This is freely downloadable from https://www.continuum.io/downloads.

The code samples of this book have been written using the Jupyter Notebook development environment. To run the Jupyter Notebooks, you need to install Anaconda Python Distribution, which has the Python language essentials, interpreter, packages used to develop the examples, and the Jupyter Notebook server.

Who this book is for

The topics in this book are expected to be useful for the following people:

  • Data scientists, professionals with a background in statistics, machine learning, and model building and validation
  • Data engineers, professionals with a background in software development
  • Software professionals looking to develop an expertise in generating data-driven business insights

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

A block of code is set as follows:

import os
import pandas as pd
%matplotlib inline
from matplotlib import pyplot as plt
import seaborn as sns

In-text code is highlighted in font and color as here: pandas.DataFrame. File and folder names are also shown in the same style, for example,  Chapter_1_Models_for_Time_Series_Analysis.ipynb or datasets/DJIA_Jan2016_Dec2016.xlsx

At several places in the book, we have referred to external URLs to cite source of datasets or other information. A URL would appear in the following text style: http://finance.yahoo.com

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "In order to download new modules, we will go to Files | Settings | Project Name | Project Interpreter."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply email feedback@packtpub.com, and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files emailed directly to you. You can download the code files by following these steps:

  1. Log in or register to our website using your email address and password.
  2. Hover the mouse pointer on the SUPPORT tab at the top.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box.
  5. Select the book for which you're looking to download the code files.
  6. Choose from the drop-down menu where you purchased this book from.
  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows
  • Zipeg / iZip / UnRarX for Mac
  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Practical-Time-Series-Analysis. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title. To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the internet, please provide us with the location address or website name immediately so that we can pursue a remedy. Please contact us at copyright@packtpub.com with a link to the suspected pirated material. We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at questions@packtpub.com, and we will do our best to address the problem.

 

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Practical Time Series Analysis
Published in: Sep 2017Publisher: PacktISBN-13: 9781788290227
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Avishek Pal

Dr. Avishek Pal, PhD, is a software engineer, data scientist, author, and an avid Kaggler living in Hyderabad, India. He achieved his Bachelor of Technology degree in industrial engineering from the Indian Institute of Technology (IIT) Kharagpur and earned his doctorate in 2015 from University of Warwick, Coventry, United Kingdom. He started his career as a software engineer at IBM India developing middleware solutions for telecom clients. This was followed by stints at a start-up product development company followed by Ericsson, the global telecom giant. After doctoral studies, Avishek started his career in India as a lead machine learning engineer for a leading US-based investment company. He is currently working at Microsoft as a senior data scientist. Avishek has published several research papers in reputed international conferences and journals.
Read more about Avishek Pal

author image
PKS Prakash

Dr. PKS Prakash is a data scientist and author. He has spent the last 12 years in developing many data science solutions in several practical areas in healthcare, manufacturing, pharmaceuticals, and e-commerce. He currently works as the data science manager at ZS Associates. He is the co-founder of Warwick Analytics, a spin-off from University of Warwick, UK. Prakash has published articles widely in research areas of operational research and management, soft computing tools, and advanced algorithms in leading journals such as IEEE-Trans, EJOR, and IJPR, among others. He has edited an article on Intelligent Approaches to Complex Systems and contributed to books such as Evolutionary Computing in Advanced Manufacturing published by WILEY and Algorithms and Data Structures using R and R Deep Learning Cookbook, published by PACKT.
Read more about PKS Prakash