Skip to content

Time Series Forecasting Basics

Trend, seasonality, baselines and time-based validation: the fundamentals of predicting future values from past ones.

Editorial team 2 min read

Forecasting predicts future values of a sequence recorded over time — sales, demand, temperature, website traffic.

Components of a Time Series

  • Trend: long-term direction.
  • Seasonality: repeating patterns — daily, weekly, yearly.
  • Cycles: longer, irregular fluctuations such as economic cycles.
  • Noise: random variation that can't be predicted.

Plotting the series and a seasonal decomposition is always the first step.

Start With Baselines

  • Naive: the next value equals the last value.
  • Seasonal naive: the next value equals the value one season ago (same day last week).
  • Moving average.

These are surprisingly hard to beat and tell you whether a complex model adds value.

Common Approaches

  • Statistical models: exponential smoothing and ARIMA-family models.
  • Machine learning: gradient boosting on lag features (previous values), rolling statistics and calendar features.
  • Deep learning: useful for many related series and complex patterns.

Validate by Time

Never shuffle. Train on the past and test on the future, ideally with rolling-origin evaluation that repeats this over several periods.

Avoid Leakage

Rolling averages and other features must use only information available before the prediction time. Features such as actual weather are unavailable when forecasting ahead — use forecasts instead.

Communicate Uncertainty

Provide prediction intervals, not just point forecasts, and explain what events the history can't anticipate.

More in Machine learning

All Machine learning guides →
Machine learning Guide · 2 min

Linear Regression Explained

The simplest predictive model: how linear regression fits a line through data, how to read its coefficients, and when it breaks down.

Machine learning 2 min read 17 Sep 2026

Machine learning Guide · 2 min

Logistic Regression for Classification

Despite its name, logistic regression is a classification method. How it produces probabilities and why it remains a strong baseline.

Machine learning 2 min read 16 Sep 2026

Machine learning Guide · 2 min

Decision Trees

How decision trees split data with simple questions, why they are easy to explain, and why single trees overfit.

Machine learning 2 min read 15 Sep 2026

Machine learning Guide · 2 min

Random Forests

Why averaging many randomised decision trees produces a robust, accurate model with little tuning.

Machine learning 2 min read 14 Sep 2026