Problem
Marketing analysts who build a marketing mix model (MMM) usually fit a linear regression, because its coefficients are easy to read. A linear model needs hand-built saturation transforms, explicit interaction terms and removal of correlated spend variables. Teams also drop some structure to keep the model readable, and accuracy suffers. The goal is to split weekly revenue among media channels and compare each channel's share of effect with its share of spend.
Example from the article: 92 weeks of revenue from the public Robyn demo dataset, with five paid channels (TV, out-of-home, print, Facebook, search) and an organic newsletter channel.
Solution in brief
Fit a Random Forest on revenue with adstocked media features, and tune the adstock decay rates and forest parameters together with Optuna under time-series cross-validation. Then explain the channels with SHAP: summed absolute SHAP values give each channel's share of effect, and SHAP-versus-spend plots show saturation without an explicit transform.
Questions this case answers
- How to split an aggregate weekly outcome among several overlapping interventions using only time-series data and no randomization, while keeping the result interpretable
- How to tune carryover parameters and model hyperparameters together on a short time series without leaking future data
- How to estimate each media channel's contribution to revenue with a tree ensemble instead of a linear marketing mix model?
- How to choose adstock decay rates for every channel automatically instead of fixing them by hand?
Tools and methods
- Random Forest (scikit-learn) — non-linear revenue model, copes with correlated channels
- Geometric adstock — carryover of each channel's spend into later weeks
- Optuna — joint search of adstock decay rates and Random Forest parameters
- Time-series cross-validation — validation that never trains on the future
- SHAP — per-channel share of effect and response curves
- Prophet — trend, seasonality and holiday decomposition
- Robyn — source of the dataset, adstock ranges and the second objective
Google or a one-time email code. No password.