6 Powerful Feature Engineering Techniques For Time Series Data (using Python)

Aishwarya Singh
Analytics Vidhya
Published in
12 min readDec 9, 2019

‘Time’ is the most essential concept in any business. We map our sales numbers, revenue, bottom line, growth, and even prepare forecasts — all based on the time component.

But consequently, this can be a complex topic to understand for beginners. There is a lot of nuance to time series data that we need to consider when we’re working with datasets that are time-sensitive.

Existing time series forecasting models undoubtedly work well in most cases, but they do have certain limitations. I’ve seen aspiring data scientists struggle to map their data when they’re given only the time component and the target variable. It’s a tricky challenge but not an impossible one.

There’s no one-size-fits-all approach here. We don’t have to force-fit traditional time series techniques like ARIMA all the time (I speak from experience!). There’ll be projects, such as demand forecasting or click prediction when you would need to rely on supervised learning algorithms.

And there’s where feature engineering for time series comes to the fore. This has the potential to transform your time series model from just a good one to a powerful forecasting model.

In this article, we will look at various feature engineering techniques for extracting useful information using the date-time column. And if you’re new to time series, I encourage you to check out the below free course:

Table of Contents

  1. Quick Introduction to Time Series
  2. Setting up the Problem Statement for Time Series Data
  3. Date-Related Features
  4. Time-Related Features
  5. Lag Features
  6. Rolling Window
  7. Expanding Window
  8. Domain-Specific

Quick Introduction to Time Series

Before we look at the feature engineering techniques, let’s brush over some basic time series concepts. We’ll be using them throughout the article so it’s best to be acquainted with them here.

How I Deployed a Machine Learning Model for the First Time

13 min read

Jul 18

19 Most Elegant Sklearn Tricks I Found After 3 Years of Use

12 min read

Jun 15

Data Science Project: Sales Forecasting with Arima

4 min read

Feb 5, 2022

Tuning ARIMA for Forecasting: An Easy Approach in Python

4 min read

Dec 31, 2022

Time Series in Python —  Part 2: Dealing with seasonal data

5 min read

Feb 14, 2019

Time Series in Python — Exponential Smoothing and ARIMA processes

12 min read

Feb 7, 2019

Explain Any Machine Learning Model in Python, SHAP

9 min read

Sep 22, 2022

11 Times Faster Hyperparameter Tuning with HalvingGridSearch

9 min read

Apr 9, 2021

Automatic Hyperparameter Tuning with Sklearn GridSearchCV and RandomizedSearchCV

6 min read

Mar 5, 2021

5 things you are doing wrong in PyCaret

6 min read

Nov 2, 2020

Aishwarya Singh
Analytics Vidhya

Making technical concepts easier to understand

Recommended from Medium

Lists

See more recommendations