Back to Projects
Forecasting / Publishing

Book Sales Demand Forecasting

Weekly demand forecasting for two long-selling book titles, comparing statistical, machine-learning, deep-learning and hybrid models on the final 32 weeks of sales.

Type
Time Series Forecasting
Domain
Publishing / Demand Planning
Best MAPE
19.6% (SARIMA)
Origin
Cambridge DS Career Accelerator coursework

The Challenge

A seasonal SARIMA model forecast 32 weeks of sales with 19.6% MAPE for one title and matched an LSTM on the other, while hybrid models added nothing.

Publishers decide on reorders, reprints and stock levels months ahead. Some titles sell steadily for years with strong seasonal peaks; others spike and fade. The question was which forecasting approach gives reliable weekly demand projections for long-selling titles, and whether more complex models are worth their cost.

Approach

01
Data preparation
Combined weekly sales records (227,224 rows across eight sheets), resampled so that weeks with no sales count as zero, and selected two long-selling titles from 2012 onwards. The final 32 weeks were held out for testing.
02
Classical models
Decomposition, ACF/PACF and stationarity tests, then SARIMA via auto_arima with yearly seasonality (52 weeks).
03
Machine learning and deep learning
XGBoost with lag, rolling-mean and calendar features, and an LSTM tuned with KerasTuner.
04
Hybrids and monthly view
Sequential (SARIMA plus LSTM on residuals) and parallel (weighted) hybrids, then monthly XGBoost and SARIMA on aggregated sales for an 8-month horizon.

Results

Model (32-week test)Title A MAETitle A errorTitle B MAETitle B error
SARIMA169.3MAPE 31.9%382.3MAPE 19.6%
LSTM170.6MAPE 22.2%592.2MAPE 28.1%
Parallel hybrid181.6sMAPE 34.8%1,174.4sMAPE 61.8%
Sequential hybrid214.3sMAPE 39.8%1,096.5sMAPE 56.6%

SARIMA was the best model for Title B. For Title A, SARIMA and the LSTM were level on absolute error, with the LSTM ahead on percentage error. Neither hybrid improved on the single models; the optimised blend weight came out at zero, meaning one model on its own was preferred.

For planning, the practical finding is that a well-specified seasonal model is a strong default for long-selling titles, and more complex models should be adopted only where they beat it on held-out data.

Known issues: the weekly XGBoost forecasts stayed flat at about 50 units against actual sales of 1,000-3,500 (a feature-update bug), so XGBoost is excluded. Title B's series was smoothed before the train/test split, which flatters its SARIMA error. Hybrid errors are sMAPE, not MAPE, so they are not directly comparable with the first two rows. Monthly SARIMA failed to produce forecasts; monthly XGBoost MAPE was 48.3% and 27.4%.

How it was tested

TEST REPORTTEST REPORTBOOK SALESBOOK SALES
Checked
  • Every model scored on the same held-out final 32 weeks, on MAE and percentage error, for two titles.
  • Decomposition, ACF/PACF and stationarity tests before SARIMA; LSTM tuned with KerasTuner.
Found
  • The weekly XGBoost forecasts stayed flat at about 50 units against actual sales of 1,000-3,500, a feature-update bug, so XGBoost is excluded.
  • Title B's series was smoothed before the train/test split, which flatters its SARIMA error.
Did not work
  • Neither hybrid improved on the single models; the optimised blend weight came out at zero.
  • Monthly SARIMA failed to produce forecasts.
Limits
  • Hybrid errors are sMAPE, not MAPE, so they are not directly comparable with the single models' percentage errors.

Technology Stack

Python statsmodels pmdarima (SARIMA) XGBoost TensorFlow / Keras KerasTuner sktime pandas Matplotlib
Interested in this work or something similar?