Featured resource
2026 Tech Forecast
2026 Tech Forecast

1,500+ tech insiders, business leaders, and Pluralsight Authors share their predictions on what’s shifting fastest and how to stay ahead.

Download the forecast
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • AI
Labs

Time Series Modeling with ARIMA

Welcome to the Time Series Modeling with ARIMA Lab! You've joined an airline's data science team, and your manager needs a forecast of passenger demand for the next two years. Forecast too low, and the airline could struggle to accommodate demand. Forecast too high, and it could allocate resources unnecessarily. Your mission is to turn historical passenger data into forecasts using ARIMA, a classical statistical approach to time series forecasting. You'll work with an Air Passengers dataset, similar to the one available on Kaggle, which contains monthly international airline passenger totals from January 1949 through December 1960. The series exhibits a clear upward trend and recurring seasonal peaks, making it a great opportunity to explore both the potential and the limitations of time series forecasting. You'll inspect and clean the data, investigate stationarity, compare ARIMA configurations, generate forecasts, and evaluate their accuracy on unseen observations. Along the way, you'll complete practical coding tasks with automated tests to validate your work. No crystal ball required. Just Python, historical data, and a forecasting challenge!

Lab platform
Lab Info
Level
Beginner
Last updated
Nov 02, 2026
Duration
30m

Contact sales

By clicking submit, you agree to our Privacy Policy and Terms of Use, and consent to receive marketing emails from Pluralsight.
Table of Contents
  1. Challenge

    Introduction

    Welcome to the Time Series Modeling with ARIMA Lab.

    You have joined an airline data science team. Your manager needs a forecast of passenger demand for the next two years.

    Forecast too low, and the airline may not seat every passenger. Forecast too high, and the airline may staff flights that do not fill.

    Your mission is to turn historical passenger totals into a forecast with ARIMA, a classical statistical model for time series.

    You work with data/AirPassengers.csv, which holds monthly international airline passenger totals from January 1949 through December 1960, plus two planted data-quality problems. The series shows an upward trend and recurring seasonal peaks.

    You inspect and clean the data, investigate stationarity, compare ARIMA configurations, generate forecasts, and evaluate accuracy on unseen months. Automated checks validate each task. Estimated time: about 30 minutes.

    Learning objectives

    By completing this lab, you will be able to:

    • Prepare and validate a chronologically indexed time series
    • Visualize temporal patterns and investigate stationarity
    • Fit and compare ARIMA models using AIC
    • Generate forecasts for unseen observations
    • Evaluate forecast accuracy using MAE and RMSE
    • Analyze forecast misses and recognize the limitations of standard ARIMA on seasonal data

    Before you start

    1. Open src/step1_know_your_passengers.py
    2. Run:
    python3 src/step1_know_your_passengers.py
    

    The BEFORE block shows 146 rows, one missing passenger value, and one duplicate month. That broken file is your starting point.

    How you work

    1. Complete the TODO functions in src/
    2. Select Validate after each task
    3. Move to the next step file when the step is complete

    If you get stuck, open the matching file in solution/. Tests import from src/, so you must complete the TODOs there to pass Validate.

  2. Challenge

    Step 1: Get to Know Your Passengers

    Before you forecast, you need a clean monthly series. The raw file in data/AirPassengers.csv is not ready yet: it is out of order, one passenger value is missing, and one March 1952 row was planted with #Passengers 999.

    In this step, you will load that file, remove the two bad rows, and create a chronological train/test split. A plot of the cleaned series is already provided for you.

    Work in src/step1_know_your_passengers.py. Look for the # TODO comments under each task.

    Run the starter script

    1. Open src/step1_know_your_passengers.py
    2. Run:
      python3 src/step1_know_your_passengers.py
      
    3. Read the BEFORE block and confirm the two rows that must be removed later

    Outcome

    Rerun the src/step1_know_your_passengers.py file to observe the outcome.

    When Step 1 is complete, you have:

    • A cleaned series of 144 months with frequency MS
    • A chronological 120 / 24 train-test split

    Move to src/step2_train_arima.py.

  3. Challenge

    Step 2: Train Your ARIMA Model

    Your cleaned series is ready. In this step, you will check stationarity, compare three ARIMA models with AIC, and forecast the 24 held-out months.

    Important rule: Fit and choose the model on the training series only. The test months are for later scoring, not for model selection.

    Work in src/step2_train_arima.py. A forecast-versus-actual plot is already provided for you after the forecast runs.

    Run the Step 2 starter

    1. Open src/step2_train_arima.py

    2. Run:

      python3 src/step2_train_arima.py
      
    3. Read the BEFORE block that states the train and test windows

    Outcome

    Rerun the src/step2_train_arima.py file to observe the outcome.

    When Step 2 is complete, you have:

    • ADF results before and after differencing
    • One ARIMA model chosen by training AIC
    • A 24-month forecast aligned to the test dates

    Move to src/step3_evaluate_forecast.py.

  4. Challenge

    Step 3: Evaluate the Forecast

    Your model has predicted the next 24 months. Now measure how close those forecasts are to reality, then analyze where a standard ARIMA model struggles with recurring seasonal peaks.

    Work in src/step3_evaluate_forecast.py. Use the held-out actual values and your existing predictions. Do not refit or tune a model on the test set.

    Run the Step 3 starter

    1. Open src/step3_evaluate_forecast.py

    2. Run:

      python3 src/step3_evaluate_forecast.py
      
    3. Read the BEFORE block that describes the scoring and analysis workflow

    Outcome

    Rerun the src/step3_evaluate_forecast.py file to observe the outcome.

    When Step 3 is complete, you have:

    • MAE and RMSE on the 24 held-out months
    • A forecast-versus-actual plot
    • The largest miss, the substantial-error months, and a clear seasonal-limitation write-up

    The required lab ends here.

    Optional stretch challenge

    If you want to go further, implement forecast_seasonal(train, test_index).

    To-do:

    1. Fit SARIMAX with order=(1, 1, 1) and seasonal_order=(1, 1, 1, 12) on the training series
    2. Forecast the same 24 test months
    3. Compare seasonal RMSE with the non-seasonal ARIMA RMSE
    Hint Use SARIMAX(...).fit(disp=False), then .forecast(steps=len(test_index)), and return a Series indexed by test_index. This stretch is optional.
About the author

Marc is a Senior Data Scientist with a solid foundation in Communication and Computer Engineering and holds a Master's degree in AI and Deep Learning from one of France's leading universities. His career is driven by a deep passion for data science and artificial intelligence, combining technical expertise with innovative thinking to deliver impactful solutions.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight