Forecasting Book Demand Using Statistical & Machine Learning Models

Compared ARIMA, SARIMA, XGBoost, LSTM and hybrid forecasting models across two book sales datasets to evaluate forecasting accuracy and business value.

Time Series Forecasting ARIMA SARIMA XGBoost LSTM Hybrid Models
The Very Hungry Caterpillar

Auto ARIMA Forecast

MAPE 17.17%
Auto ARIMA forecast for The Very Hungry Caterpillar showing training data, test data and forecast values.

Two datasets. Seven model approaches. One forecasting workflow.

The project investigated whether historical sales data could forecast future book demand accurately enough to support procurement, stock planning and inventory decisions.

2 Books analysed
7 Model approaches
16.21% Best Caterpillar MAPE
23.31% Best Alchemist MAPE

Why demand forecasting matters

Book sales are affected by trend, seasonality, popularity cycles and sudden demand spikes. For publishers and retailers, poor forecasting can create stock shortages, excess inventory and inefficient procurement decisions.

This project used historical sales data for The Very Hungry Caterpillar and The Alchemist to test whether future demand could be predicted using a mix of classical statistical models and machine learning techniques.

The goal was not simply to build a model, but to compare approaches objectively and identify which method produced the most useful forecasts for each dataset.

Core Question

Can historical sales patterns support better planning decisions?

The analysis focused on trend, seasonality, forecast accuracy and residual behaviour to understand whether model outputs were reliable enough to inform business decision-making.

Procurement Inventory Demand Planning Forecast Accuracy

Trend and seasonality were visible in the sales series

Decomposition helped separate the observed sales volume into trend, seasonal and residual components, making it easier to understand the underlying structure before modelling.

The Very Hungry Caterpillar

Time Series Decomposition

Trend · Seasonality · Residuals
Time series decomposition plot for The Very Hungry Caterpillar showing observed volume, trend, seasonality and residuals.
01

Trend

Sales showed a long-term upward movement, suggesting the series was not purely random.

02

Seasonality

Recurring fluctuations indicated that repeating demand patterns were present in the data.

03

Residuals

Remaining noise highlighted the limits of modelling and the need for forecast diagnostics.

The Very Hungry Caterpillar

This dataset contained larger sales volumes, visible seasonality and recurring demand movement. Statistical forecasting approaches performed particularly well, with the strongest monthly result achieved by SARIMA.

SARIMA Best model
16.21% Best MAPE
Weekly Hybrid Test

Sequential Hybrid Forecast

MAPE 17.13%
Sequential hybrid forecast for The Very Hungry Caterpillar showing train, actual and forecast lines.

The Alchemist

The Alchemist behaved differently, with a sharp demand spike followed by lower, more stable sales. The best result came from a parallel hybrid approach, showing that different datasets can favour different forecasting methods.

Hybrid Best model family
23.31% Best MAPE
The Alchemist

Parallel Hybrid Forecast

MAPE 23.31%
Parallel hybrid forecast for The Alchemist showing train, actual and forecast lines.

Model performance varied by dataset

The results showed that no single model consistently dominated. The best approach depended on the structure and behaviour of the individual sales series.

Model Caterpillar MAPE Alchemist MAPE Comment
Auto ARIMA Weekly 17.17% 25.79% Strong statistical baseline
XGBoost Weekly 26.89% 34.93% Lag-based ML approach underperformed here
LSTM Weekly 23.85% 27.15% Deep learning did not outperform simpler models
Sequential Hybrid Weekly 17.13% 25.80% Competitive hybrid performance
Parallel Hybrid Weekly 17.07% 23.31% Best weekly result for both books
SARIMA Monthly 16.21% 35.96% Best overall result for Caterpillar
XGBoost Monthly 16.74% 40.42% Strong for Caterpillar, weak for Alchemist

End-to-end forecasting workflow

The project followed a structured analytical process, moving from exploration and diagnostics through to model development and evaluation.

01
Data preparation
Cleaned and transformed historical sales data into weekly and monthly time series formats.
02
Exploratory analysis
Reviewed sales patterns, demand spikes, volatility and long-term movement across both books.
03
Decomposition and diagnostics
Used decomposition, ADF testing, ACF/PACF and residual checks to understand model suitability.
04
Model development
Built ARIMA, SARIMA, XGBoost, LSTM, sequential hybrid and parallel hybrid forecasting models.
05
Evaluation
Compared forecasts using MAE, RMSE and MAPE to identify the most accurate and useful approach.

What the project demonstrated

01

Model choice matters

Different datasets favoured different forecasting approaches, so model selection needed to be evidence-led.

02

Simpler models stayed competitive

Classical statistical methods performed strongly and, in some cases, outperformed more complex ML models.

03

Forecasts need business context

Accuracy metrics are useful, but the real value comes from supporting procurement and inventory decisions.

Technologies used

py Python
pd Pandas
np NumPy
sm Statsmodels
pm pmdarima
xg XGBoost
tf TensorFlow
mp Matplotlib
nb Google Colab
gh GitHub

Explore the full project

The full repository contains the supporting notebooks, preprocessing steps, model outputs and evaluation work.