Module 4: Time Series Forecasting

Module Overview

This final module explores Time Series Forecasting, a specialized application of machine learning that deals with data points indexed in chronological order. Time series data is unique because the temporal ordering of observations is critical and often contains patterns like trends, seasonality, and cycles that can be leveraged for prediction.

Building on the LSTM networks covered in Module 1, you'll learn how to adapt these powerful recurrent neural networks specifically for time series problems. By the end of this module, you'll understand how to preprocess temporal data, structure LSTM models for forecasting, and evaluate their performance—skills that are highly valuable across industries from finance and economics to energy and healthcare.

Learning Objectives

1. Understand time series data and forecasting

  • Identify the key characteristics of time series data (temporal ordering, patterns, autocorrelation)
  • Recognize different time series components (trend, seasonality, cyclical patterns, irregular components)
  • Understand common applications of time series forecasting across industries
  • Apply appropriate preprocessing techniques for time series data

2. Apply LSTM networks to time series problems

  • Understand why LSTM networks are well-suited for time series forecasting
  • Structure input data in the appropriate format for LSTM models
  • Configure LSTM architectures for different forecasting scenarios
  • Implement single-step and multi-step forecasting approaches

3. Evaluate and improve time series forecasting models

  • Select appropriate evaluation metrics for time series models (MAE, MSE, RMSE, MAPE)
  • Implement time series cross-validation techniques
  • Compare LSTM performance against baseline forecasting methods
  • Apply hyperparameter tuning to improve model performance

Guided Project

Time Series Forecasting with LSTM Networks

As the final module in this sprint, there is no lecture video provided. You are expected to work through the lecture notebook independently, applying the knowledge you've gained throughout this sprint. Use the additional resources and self-directed research to fill in any gaps in your understanding.

Project Resources

Guided Project File:

DS_434_Time_Series_Forecasting_Lecture.ipynb

Module Assignment

Please read the assignment file in the GitHub repository for detailed instructions on completing your assignment tasks.

Assignment File:

DS_434_LSTM_Time_Series_Forecasting_Assignment.ipynb

In this culminating assignment, you will apply time series forecasting techniques to real-world data. The assignment consists of two parts:

  • Part 1: Choose either Option A or Option B
    • Option A: Software Engineering - Create a ForecastingToolkit class that packages the workflow of time series forecasting
    • Option B: A Deeper Dive in Time-Series Forecasting - Compare various forecasting methods including 1D Convolutional Neural Networks
  • Part 2: Apply time series forecasting to a real dataset
    • Select a time series dataset (either univariate or multivariate)
    • Apply methods learned in Part 1 to analyze and forecast the data
    • Perform hyperparameter tuning to optimize your forecasts
    • Compare your model's performance (MAE) against a naive baseline
    • Critically evaluate your forecasting results

Assignment Solution Video

As this is the final module of the sprint, there is no solution video provided. You are encouraged to complete this assignment independently, applying all the knowledge you've gained throughout the sprint. If you encounter any difficulties or have questions, please reach out to the Learning Assistants who are available to support your learning journey.

Check for Understanding

Complete the following items to test your understanding:

  • Explain the difference between univariate and multivariate time series data
  • Describe why the temporal ordering of data is crucial in time series analysis
  • Explain the concept of a sliding window approach in preparing data for LSTM models
  • Compare stateful vs. stateless LSTM configurations and their applications
  • Discuss the pros and cons of different evaluation metrics for time series forecasting

Additional Resources