Machine Learning (ML) · Advanced level

Advanced level · Module 3: Time Series and Forecasting · Lesson 1 of 4

Understanding Time Series

Recognise trend, seasonality and irregular movements, and prepare time series for modelling.

In this lesson you will

  • Plot and decompose a time series
  • Handle missing periods and different frequencies

Key concepts

trendseasonalitynoiseresampling

The lesson

A time series is a value recorded over time, such as the monthly price of maize. It typically combines a long-term trend, seasonal patterns — prices often rise before harvest — and irregular noise or shocks.

Plot the series first. Decomposition separates trend and seasonality so you can see each clearly.

Make the series regular: one value per period, with gaps filled carefully or marked. pandas resample converts between frequencies, for example daily records to monthly averages.

Step by step

  1. Plot monthly prices for four markets.
  2. Decompose one series into trend and seasonality.
  3. Find and handle missing months.
  4. Resample weekly data to monthly.

Practice activity

Describe the price patterns in each market from plots and decomposition.

Expected result: A description of trend, seasonality and shocks per market, with prepared series.

Check your understanding

  1. What is seasonality?

    Show answer

    A pattern that repeats over a fixed period, such as each year.

  2. Why make a time series regular before modelling?

    Show answer

    Models assume one value per period, so gaps and mixed frequencies cause errors.

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.