Exponential Smoothing & Moving Average Baseline Models0%

Exponential Smoothing & Moving Average Baseline Models

Beginner12 min read•Updated: Jul 11, 2026
Study Materials

Exponential Smoothing & Moving Average Baseline Models

Before training complex machine learning models (like Random Forests or Gradient Boosted Trees), data analysts must establish robust statistical baseline models. Simple baseline forecasts set the performance floor that any advanced algorithm must decisively beat to justify its implementation complexity and computational overhead.


1. Classical Baseline Benchmarks

  1. 1
    Naïve Forecast: Forecasts that tomorrow will equal today: $hat{Y}_{t+1} = Y_t$.
  2. 2
    Seasonal Naïve Forecast: Forecasts that next Monday will equal last Monday: $hat{Y}_{t+1} = Y_{t+1-m}$ (where $m=7$).
  3. 3
    Simple Moving Average Forecast: Forecasts the average of the last $k$ periods.
  4. 4
    Simple Exponential Smoothing (SES): Weights recent observations using smoothing parameter $alpha in (0, 1)$.

2. Implementing Holt-Winters Exponential Smoothing

Holt-Winters Exponential Smoothing models both trend ($eta$) and seasonality ($gamma$):

Python
import pandas as pd
from statsmodels.tsa.holtwinters import ExponentialSmoothing
from sklearn.metrics import mean_absolute_percentage_error, mean_squared_error
import numpy as np
 
# Split train and test sets chronologically (Never shuffle time series!)
train = df.iloc[:-30] # All data up to last 30 days
test = df.iloc[-30:] # Last 30 days holdout
 
# Fit Holt-Winters Model
hw_model = ExponentialSmoothing(
train['sales'],
trend='add',
seasonal='add',
seasonal_periods=7
).fit()
 
# Forecast 30 days ahead
hw_forecast = hw_model.forecast(steps=30)

3. Evaluating Forecast Accuracy

Evaluate forecasts against ground truth test sets using standard business metrics:

Python
# 1. Mean Absolute Error (MAE) - easy for executives to understand ($ error)
mae = np.mean(np.abs(test['sales'] - hw_forecast))
 
# 2. Root Mean Squared Error (RMSE) - penalizes large catastrophic errors heavily
rmse = np.sqrt(mean_squared_error(test['sales'], hw_forecast))
 
# 3. Mean Absolute Percentage Error (MAPE) - relative % error
mape = mean_absolute_percentage_error(test['sales'], hw_forecast) * 100
 
print(f"MAE: ${mae:,.2f}")
print(f"RMSE: ${rmse:,.2f}")
print(f"MAPE: {mape:.2f}%")

4. Comparing Against the Naïve Baseline

Python
# Naive baseline (yesterday's value)
naive_forecast = test['sales'].shift(1).bfill()
naive_mape = mean_absolute_percentage_error(test['sales'], naive_forecast) * 100
 
print(f"Naive Baseline MAPE: {naive_mape:.2f}% vs Holt-Winters MAPE: {mape:.2f}%")

If an advanced ML model scores an RMSE of 120 while a Naïve forecast scores 115, the ML model is adding negative value and should never be deployed!


Interactive Quiz

Multiple Choice Questions

Question 1
Why must time-series data NEVER be split into train and test sets using standard random train_test_split from scikit-learn?
Question 2
In Holt-Winters exponential smoothing, what does the additive seasonal component assume?
Question 3
Which evaluation metric measures forecast error as an intuitive percentage relative to actual values?
Question 4
What is the Naïve Forecast benchmark?
Question 5
If actual test sales are 200 units and the model forecasts 180 units, what is the Absolute Error?

Next Lesson

Supervised vs Unsupervised Learning for Business Analysts

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

PrevNext