learntodriveai.dev/Data Science/Time Series Forecasting: Seasonal Patterns and Prediction Intervals
Data ScienceProject 117 unitsVerified on 16 October 2026

Time Series Forecasting: Seasonal Patterns and Prediction Intervals

Carlos FerreiraDirector of Operations Planning · Port authority · Lisbon, Portugal
Formal memo · from Carlos
Our volume forecasts have been unreliable. The summer 2025 staffing shortfall resulted in vessel queuing delays that cost the port authority an estimated EUR 2.1 million in penalty clauses.
Chat with Carlos

What you hand back

  • Monthly forecasts for each trade lane
  • Prediction intervals for staffing decisions
  • A plain-language methodology for the commission
  • A reusable assumption-checking skill
  • A forecast report with stated limitations

7 units

  1. Unit 1: Carlos's request

    Set up the project, read the data dictionary and governance file, and take in Carlos's memo.

    Open unit 1
  2. Unit 2: Profiling temporal data

    Load and profile the monthly volumes, then plot each of the five trade lanes over time.

    Open unit 2
  3. Unit 3: Stationarity and decomposition

    Test each trade lane for stationarity with the ADF test and decompose the seasonal patterns.

    Open unit 3
  4. Unit 4: Building the forecasting models

    Split the data by time, set a seasonal naive baseline, and fit models for the trade lanes.

    Open unit 4
  5. Unit 5: Writing your first skill and hooks

    Write a skill that encodes the assumption checks and set up hooks that enforce the temporal split.

    Open unit 5
  6. Unit 6: Prediction intervals and forecast reliability

    Produce 80% prediction intervals for each lane and check how many actual months fall inside.

    Open unit 6
  7. Unit 7: Carlos's forecast report

    Write the forecast report with an operational summary, a plain-language methodology and a limitations section.

    Open unit 7
Read the full brief

Staffing and budget decisions at a Portuguese port authority ride on next year's container volumes. You build monthly forecasts accurate enough for those calls and explainable enough that the operations director can defend them to the port commission.

The discipline skills: testing stationarity with ADF tests, decomposing seasonal patterns, fitting ARIMA and SARIMAX models with statsmodels, producing prediction intervals instead of point forecasts, and comparing model performance against a seasonal naive baseline.

The AI-direction lesson: random train/test splitting on time series data is AI's most destructive default in data science -- and this is the project where it matters most. AI will produce forecasts that look good with convincing accuracy numbers, but if validation used random splits, every number is meaningless. You also write your first skill file and configure your first hooks -- infrastructure that makes temporal discipline automatic rather than something you remember to enforce. The skill encodes the verification workflow as a reusable procedure; the hook makes temporal discipline automatic so AI cannot skip it, even when you forget to check.

Your Role

You deliver forecasts with prediction intervals, not point estimates. This is the first project working with time series data, and you also write infrastructure -- skills and hooks -- that makes analytical discipline automatic rather than something you remember each session.

What's New

Last time, you deepened the causal validation for Gabriela's loyalty program -- sensitivity analysis, delegated review through a custom agent, cross-tool verification with Codex CLI. The analytical terrain was familiar; the infrastructure was new.

This time, the analytical terrain is unfamiliar. Time series is where AI's default behavior is most destructive -- random train/test splitting on temporal data produces fictional accuracy that looks impressive but predicts nothing. Stationarity must be tested before any model is fit. Seasonal patterns must be decomposed before model specification. Prediction intervals replace point forecasts.

The hard part is temporal discipline. AI will produce forecasts that look good, and the accuracy numbers will be convincing. But if the validation used random splits instead of temporal splits, every number is meaningless.

Tools

  • Python 3.11+ via your conda "ds" environment
  • Jupyter Notebook for the analysis
  • pandas for data handling
  • statsmodels -- familiar library, new methods: ARIMA, SARIMAX, ADF test, seasonal decomposition
  • scipy for statistical analysis
  • matplotlib / seaborn for visualization
  • DuckDB and DuckDB MCP server (carry-forward, available if needed)
  • Claude Code -- skills and hooks are new features of an existing tool
  • Git / GitHub for version control

Materials

You receive:

  • Eight years of monthly container volumes by trade lane
  • Economic indicator data (GDP, trade indices, fuel prices)
  • A data dictionary
  • A methodology page from the port's previous forecasting consultancy (reviewed in Unit 4)
  • A project CLAUDE.md

No methodology templates, no analysis specifications, no model configuration guides.

Materials · 5 files
Start Project 11

You work at a computer with a terminal. Signed in, your place is saved.