National Economics University logo Faculty of Data Science and Artificial Intelligence logo BAI Lab logo

Topic 9

Airline Passenger Time Series

Easy
Airline Passenger Time Series

Topic 9 โ€“ Airline Passenger Time Series (Statsmodels built-in)

Level: Easy Goal: Classic monthly airline passenger series (trend + seasonality) using a library dataset.

Dataset & Library

Installation

pip install statsmodels

Data Loading

import pandas as pd
from statsmodels.datasets import get_rdataset

data = get_rdataset("AirPassengers", "datasets").data
# Original data typically has a 'time' or 'Month' column and 'value' column
print(data.head())

# If there is only an index and a passenger column:
# Example conversion (adapt depending on structure)
data["Month"] = pd.date_range(start="1949-01-01", periods=len(data), freq="M")
data = data.set_index("Month").sort_index()
data.rename(columns={data.columns[0]: "Passengers"}, inplace=True)

print(data.head())

Implementation Steps

1. Data Loading and Exploration

2. Exploratory Data Analysis (EDA)

3. Stationarity Analysis

4. Model Building

5. Model Selection

6. Model Evaluation

7. Forecasting

Expected Deliverables

  1. EDA Report:
  1. Model Results:
  1. Code:

Tips

Starter Notebook

The starter notebook contains installation instructions and data loading code to help you get started with this topic.

๐Ÿ““ View Starter Notebook on GitHub

Note: You can view the notebook directly on GitHub or download it to run locally in Jupyter.

Getting Started

This topic includes:

Navigate to the Topic/9.Airline_Passengers/ directory to access all resources.

โ† Back to All Topics