Problem
Marketing analysts need a response curve for each media channel: the sales a channel brings at a given spend, flattening as spend grows. Without it they cannot say where the next budget unit pays best. The usual way is a saturation function inside a linear regression. A tree ensemble learns non-linearity on its own and has no such function, so its curve needs another route.
Example from the article: On 208 weeks of revenue and spend for five channels (TV, out-of-home, print, Facebook, search) from the public Robyn dataset, the author builds curves for a Ridge regression and a LightGBM model and compares them.
Solution in brief
Fit the model, then draw each channel's curve in one of two ways. With a saturation transformation, plot the transformation. With any model, vary one channel while holding the other variables constant and plot the response (partial dependence). On Ridge the two curves overlap. On LightGBM only partial dependence is available, and SHAP values approximate it.
Questions this case answers
- How to draw the response of an outcome to the level of each input from a fitted model when the model is either a parametric curve or a tree ensemble without a closed-form curve
- How to build a response curve that shows diminishing returns for each media channel in a marketing mix model
- How to get response curves from a gradient boosting model, which has no built-in saturation function
- How to check whether a saturation-function curve and a partial dependence curve agree
Tools and methods
- Hill saturation and adstock — diminishing returns and carryover of an ad's effect.
- Ridge regression (scikit-learn) — the linear model, tuned with Optuna and time-based cross-validation.
- LightGBM with monotonic constraints — non-linear model without a saturation transformation.
- Partial dependence — response curve for any model.
- SHAP — per-observation contributions, overlaid as a cross-check.
Google or a one-time email code. No password.