Registry / ai-ml / google-meridian

google-meridian

JSON →
library1.7.0pypypiunverified

Google's open source mixed marketing model (MMM) library. It helps advertisers understand return on investment (ROI) and optimize ad spend. Current version: 1.6.0. Released quarterly.

pip install google-meridian
INSTALL
IMPORT
SIG · GOOGLE-MERIDIAN
G
google-meridian
ai-mlpythonv1.7.0
Install
56.0s avg
Import
Disk
2637MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.7.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 57.9s
py 3.11
✕ build_error
✓ 54.7s
py 3.12
✕ build_error
✓ 55.4s
py 3.13
✕ build_error
✓ 56.2s
py 3.9
✕ build_error
✕ build_error
2637MB installed
● package 2637MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Meridian
from meridian import Meridian
Correct import from the top-level meridian package.
MeridianData
from meridian.data import MeridianData
Data container class.
setup_data
from meridian.data import setup_data
Helper to load data into MeridianData.
run_inference
from meridian.analysis import run_inference
Run inference on a fitted model.
plot_media_effectiveness_curves
from meridian.analysis import plot_media_effectiveness_curves
Generate diagnostic plots.
Model
import meridian.Model
Model is not a direct module; Meridian is the main class in the meridian package.

Basic workflow: load data, prepare MeridianData, initialize Meridian model, fit, and get ROI summary.

import pandas as pd from meridian import Meridian from meridian.data import setup_data # Load your data (example: CSV) data = pd.read_csv('mmm_data.csv') # Create MeridianData object md = setup_data(data, media_channels=['tv', 'digital'], non_media_variables=['price', 'macro_index'], response='sales', target_roi=2.0) # Initialize model model = Meridian() # Fit model (sampling may take time) model.fit(md) # Run inference and get ROI summary summary = model.get_summary(md) print(summary)
Debug
Known issues
gotchaData must be in a specific format: media channels as columns with non-negative values, response column as numeric, and no missing values. Missing values cause silent errors.
fix
Preprocess data: impute missing values and ensure all media channel columns have dtype float64.
affects: all
deprecatedThe 'Meridian' class has changed its API in v1.4.0. The old method 'model.fit(data, ...)' now expects a MeridianData object instead of raw pandas DataFrame.
fix
Use setup_data() or MeridianData.from_dataframe() to convert data before calling fit().
affects: >=1.4.0
gotchaSampling can be extremely slow (hours) with default settings on large datasets. Many users think the code is stuck.
fix
Reduce 'num_warmup' and 'num_samples' parameters in Meridian constructor (e.g., Meridian(num_warmup=50, num_samples=100)).
affects: all
gotchaMCMC diagnostics (R-hat, ESS) may not be computed if TensorFlow Probability version is mismatched. Installation does not enforce compatible TFP version.
fix
Use tfp-nightly or pin TFP version: pip install tensorflow-probability==0.22.0
affects: all
Upgrade
Version history
1.7.0latest on PyPI · released Jun 18, 2026
Audit
Dependencies
numpyrequiredNumerical computations
pandasrequiredData handling
google-api-python-clientoptionalGoogle API client (for some features)
google-cloud-bigqueryoptionalBigQuery data source
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
google-meridian — pip install google-meridian · libregistry