LightweightMMM was Google's first open-source Bayesian MMM, and it taught a lot of marketers what MMM even was. Before you build anything on it, one honest caveat: Google no longer supports it and points you to Meridian instead.
So treat this as a tour of how it works and why it matters, and start new projects in its successor.
What LightweightMMM is, and its status
LightweightMMM is a Python Bayesian MMM library built on NumPyro and JAX, designed to fit a media mix model on modest data without a research team.
It's now deprecated. Google's Meridian is the maintained successor and inherits the same ideas, so anything you learn here transfers, but the maintenance and new features live in Meridian.
Why it's still worth understanding
The concepts LightweightMMM made concrete are the concepts every MMM shares, so it's a clean way to learn the moving parts:
- Adstock, the idea that today's impressions keep working for days or weeks.
- Saturation, the diminishing return as you pour more into a channel.
- Priors, the Bayesian way of encoding what you already believe before the data speaks.
Understand those three and Meridian, Robyn, and any other MMM stop looking like magic.
How a fit works
The workflow is the same shape as any MMM: prepare weekly data, scale it, fit, then read contributions and optimize.
pip install lightweight_mmm
# in Python
from lightweight_mmm import lightweight_mmm
mmm = lightweight_mmm.LightweightMMM(model_name="hill_adstock")
mmm.fit(media=media_scaled,
media_prior=costs,
target=target_scaled,
number_warmup=1000,
number_samples=1000)
After fitting, you pull channel contributions and run the optimizer for a suggested budget split, exactly as you would elsewhere.
What to carry over to Meridian
The habits matter more than the syntax. Feed the model two years of clean weekly data, calibrate it with a real experiment, and read the credible intervals rather than the point estimate.
Those hold in Meridian without change, which is the point: the discipline is portable even when the library isn't.
Where it bites
- Building new, long-term work on a deprecated library, then hitting bugs nobody will fix.
- Too little data, so the priors do all the work and the data does none.
- Skipping calibration and trusting a pretty decomposition that no experiment ever checked.
What a fitted model tells you
Once fit, LightweightMMM decomposes your KPI into a baseline plus each channel's contribution, with credible intervals around every estimate. The intervals are the honest part: they show how sure the model is, and a channel with only a few weeks of spend gets an interval so wide it's useless.
The optimizer then proposes a budget split. Treat it as a hypothesis to test with a real experiment, not an instruction to execute, because a model trained only on history can't see a channel it never varied.
Migrating to Meridian
If you already have a LightweightMMM model, moving to Meridian is mostly a data and priors migration, not a new way of thinking. The same weekly inputs, the same adstock and saturation ideas, and the same calibration discipline all carry across.
Do it sooner rather than later, because bug fixes and new features now land only in Meridian. Stand up Meridian alongside the old model, reproduce last quarter's result, and once the two roughly agree, retire the LightweightMMM pipeline for good. Keep the old notebooks for reference only, and point every new report at Meridian, so nobody on the team accidentally revives a dead dependency six months from now.
LightweightMMM is the model that taught the market MMM, and that's exactly the role to give it now: a teacher, not a foundation. Learn adstock, saturation, and priors here, then build the real thing in Meridian.
Want a stronger data analyst role or a raise? Grab the FREE Product Analyst Playbook and get the exact roadmap to your next offer.
