google-meridian 1.3.0__tar.gz → 1.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. google_meridian-1.3.2/MANIFEST.in +2 -0
  2. google_meridian-1.3.2/PKG-INFO +209 -0
  3. {google_meridian-1.3.0 → google_meridian-1.3.2}/README.md +1 -1
  4. google_meridian-1.3.2/google_meridian.egg-info/PKG-INFO +209 -0
  5. {google_meridian-1.3.0 → google_meridian-1.3.2}/google_meridian.egg-info/SOURCES.txt +24 -10
  6. {google_meridian-1.3.0 → google_meridian-1.3.2}/google_meridian.egg-info/requires.txt +9 -5
  7. {google_meridian-1.3.0 → google_meridian-1.3.2}/google_meridian.egg-info/top_level.txt +1 -0
  8. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/__init__.py +1 -2
  9. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/analyzer.py +0 -1
  10. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/optimizer.py +5 -3
  11. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/review/checks.py +81 -30
  12. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/review/constants.py +4 -0
  13. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/review/results.py +40 -9
  14. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/summarizer.py +1 -1
  15. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/visualizer.py +1 -1
  16. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/backend/__init__.py +229 -24
  17. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/backend/test_utils.py +194 -0
  18. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/constants.py +1 -0
  19. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/data/load.py +2 -0
  20. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/eda/__init__.py +0 -1
  21. google_meridian-1.3.2/meridian/model/eda/constants.py +31 -0
  22. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/eda/eda_engine.py +353 -45
  23. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/eda/eda_outcome.py +21 -1
  24. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/knots.py +17 -0
  25. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/model_test_data.py +15 -0
  26. {google_meridian-1.3.0/meridian/analysis → google_meridian-1.3.2/meridian}/templates/card.html.jinja +1 -1
  27. {google_meridian-1.3.0/meridian/analysis → google_meridian-1.3.2/meridian}/templates/chart.html.jinja +1 -1
  28. {google_meridian-1.3.0/meridian/analysis → google_meridian-1.3.2/meridian}/templates/chips.html.jinja +1 -1
  29. {google_meridian-1.3.0/meridian/analysis → google_meridian-1.3.2/meridian/templates}/formatter.py +12 -1
  30. google_meridian-1.3.2/meridian/templates/formatter_test.py +216 -0
  31. {google_meridian-1.3.0/meridian/analysis → google_meridian-1.3.2/meridian}/templates/insights.html.jinja +1 -1
  32. {google_meridian-1.3.0/meridian/analysis → google_meridian-1.3.2/meridian}/templates/stats.html.jinja +1 -1
  33. {google_meridian-1.3.0/meridian/analysis → google_meridian-1.3.2/meridian}/templates/style.scss +1 -1
  34. {google_meridian-1.3.0/meridian/analysis → google_meridian-1.3.2/meridian}/templates/summary.html.jinja +4 -2
  35. {google_meridian-1.3.0/meridian/analysis → google_meridian-1.3.2/meridian}/templates/table.html.jinja +1 -1
  36. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/version.py +1 -1
  37. {google_meridian-1.3.0 → google_meridian-1.3.2}/pyproject.toml +12 -11
  38. google_meridian-1.3.2/schema/__init__.py +30 -0
  39. google_meridian-1.3.2/schema/serde/__init__.py +26 -0
  40. google_meridian-1.3.2/schema/serde/constants.py +48 -0
  41. google_meridian-1.3.2/schema/serde/distribution.py +515 -0
  42. google_meridian-1.3.2/schema/serde/eda_spec.py +192 -0
  43. google_meridian-1.3.2/schema/serde/function_registry.py +143 -0
  44. google_meridian-1.3.2/schema/serde/hyperparameters.py +363 -0
  45. google_meridian-1.3.2/schema/serde/inference_data.py +105 -0
  46. google_meridian-1.3.2/schema/serde/marketing_data.py +1321 -0
  47. google_meridian-1.3.2/schema/serde/meridian_serde.py +413 -0
  48. google_meridian-1.3.2/schema/serde/serde.py +47 -0
  49. google_meridian-1.3.2/schema/serde/test_data.py +4608 -0
  50. google_meridian-1.3.0/meridian/model/eda/constants.py → google_meridian-1.3.2/schema/utils/__init__.py +2 -6
  51. google_meridian-1.3.2/schema/utils/time_record.py +156 -0
  52. {google_meridian-1.3.0 → google_meridian-1.3.2}/setup.py +1 -1
  53. google_meridian-1.3.0/MANIFEST.in +0 -2
  54. google_meridian-1.3.0/PKG-INFO +0 -409
  55. google_meridian-1.3.0/google_meridian.egg-info/PKG-INFO +0 -409
  56. google_meridian-1.3.0/meridian/model/eda/meridian_eda.py +0 -220
  57. {google_meridian-1.3.0 → google_meridian-1.3.2}/LICENSE +0 -0
  58. {google_meridian-1.3.0 → google_meridian-1.3.2}/google_meridian.egg-info/dependency_links.txt +0 -0
  59. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/__init__.py +0 -0
  60. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/review/__init__.py +0 -0
  61. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/review/configs.py +0 -0
  62. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/review/reviewer.py +0 -0
  63. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/summary_text.py +0 -0
  64. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/analysis/test_utils.py +0 -0
  65. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/backend/config.py +0 -0
  66. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/data/__init__.py +0 -0
  67. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/data/arg_builder.py +0 -0
  68. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/data/data_frame_input_data_builder.py +0 -0
  69. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/data/input_data.py +0 -0
  70. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/data/input_data_builder.py +0 -0
  71. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/data/nd_array_input_data_builder.py +0 -0
  72. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/data/test_utils.py +0 -0
  73. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/data/time_coordinates.py +0 -0
  74. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/mlflow/__init__.py +0 -0
  75. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/mlflow/autolog.py +0 -0
  76. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/__init__.py +0 -0
  77. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/adstock_hill.py +0 -0
  78. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/eda/eda_spec.py +0 -0
  79. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/media.py +0 -0
  80. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/model.py +0 -0
  81. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/posterior_sampler.py +0 -0
  82. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/prior_distribution.py +0 -0
  83. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/prior_sampler.py +0 -0
  84. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/spec.py +0 -0
  85. {google_meridian-1.3.0 → google_meridian-1.3.2}/meridian/model/transformers.py +0 -0
  86. {google_meridian-1.3.0 → google_meridian-1.3.2}/setup.cfg +0 -0
@@ -0,0 +1,2 @@
1
+ global-exclude *_test.py
2
+ include meridian/templates/*
@@ -0,0 +1,209 @@
1
+ Metadata-Version: 2.4
2
+ Name: google-meridian
3
+ Version: 1.3.2
4
+ Summary: Google's open source mixed marketing model library, helps you understand your return on investment and direct your ad spend with confidence.
5
+ Author-email: The Meridian Authors <no-reply@google.com>
6
+ Project-URL: homepage, https://github.com/google/meridian
7
+ Project-URL: repository, https://github.com/google/meridian
8
+ Project-URL: changelog, https://github.com/google/meridian/blob/main/CHANGELOG.md
9
+ Project-URL: documentation, https://developers.google.com/meridian
10
+ Keywords: mmm
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Topic :: Other/Nonlisted Topic
14
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: arviz
19
+ Requires-Dist: altair>=5
20
+ Requires-Dist: immutabledict
21
+ Requires-Dist: joblib
22
+ Requires-Dist: natsort<8,>=7.1.1
23
+ Requires-Dist: numpy<3,>=2.0.2
24
+ Requires-Dist: pandas<3,>=2.2.2
25
+ Requires-Dist: patsy<1,>=0.5.3
26
+ Requires-Dist: scipy<2,>=1.13.1
27
+ Requires-Dist: statsmodels>=0.14.5
28
+ Requires-Dist: tensorflow<2.21,>=2.18
29
+ Requires-Dist: tensorflow-probability<0.26,>=0.25
30
+ Requires-Dist: tf-keras<2.21,>=2.18
31
+ Requires-Dist: xarray
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
34
+ Requires-Dist: pytest-xdist; extra == "dev"
35
+ Requires-Dist: pylint>=2.6.0; extra == "dev"
36
+ Requires-Dist: pyink; extra == "dev"
37
+ Provides-Extra: colab
38
+ Requires-Dist: psutil; extra == "colab"
39
+ Requires-Dist: python-calamine; extra == "colab"
40
+ Provides-Extra: and-cuda
41
+ Requires-Dist: tensorflow[and-cuda]<2.21,>=2.18; extra == "and-cuda"
42
+ Provides-Extra: mlflow
43
+ Requires-Dist: mlflow; extra == "mlflow"
44
+ Provides-Extra: jax
45
+ Requires-Dist: jax==0.5.3; extra == "jax"
46
+ Requires-Dist: jaxlib==0.5.3; extra == "jax"
47
+ Requires-Dist: tensorflow-probability[substrates-jax]==0.25.0; extra == "jax"
48
+ Provides-Extra: schema
49
+ Requires-Dist: mmm-proto-schema; extra == "schema"
50
+ Requires-Dist: semver; extra == "schema"
51
+ Dynamic: license-file
52
+
53
+ # About Meridian
54
+
55
+ Marketing mix modeling (MMM) is a statistical analysis technique that measures
56
+ the impact of marketing campaigns and activities to guide budget planning
57
+ decisions and improve overall media effectiveness. MMM uses aggregated data to
58
+ measure impact across marketing channels and account for non-marketing factors
59
+ that impact sales and other key performance indicators (KPIs). MMM is
60
+ privacy-safe and does not use any cookie or user-level information.
61
+
62
+ Meridian is an MMM framework that enables advertisers to set up and run their
63
+ own in-house models. Meridian helps you answer key questions such as:
64
+
65
+ * How did the marketing channels drive my revenue or other KPI?
66
+ * What was my marketing return on investment (ROI)?
67
+ * How do I optimize my marketing budget allocation for the future?
68
+
69
+ Meridian is a highly customizable modeling framework that is based on
70
+ [Bayesian causal inference](https://developers.google.com/meridian/docs/causal-inference/bayesian-inference).
71
+ It is capable of handling large scale geo-level data, which is encouraged if
72
+ available, but it can also be used for national-level modeling. Meridian
73
+ provides clear insights and visualizations to inform business decisions around
74
+ marketing budget and planning. Additionally, Meridian provides methodologies to
75
+ support calibration of MMM with experiments and other prior information, and to
76
+ optimize target ad frequency by utilizing reach and frequency data.
77
+
78
+ If you are using LightweightMMM, see the
79
+ [migration guide](https://developers.google.com/meridian/docs/migrate) to help
80
+ you understand the differences between these MMM projects.
81
+
82
+ ## Install Meridian
83
+
84
+ Python 3.11 or 3.12 is required to use Meridian. We also recommend using a
85
+ minimum of 1 GPU.
86
+
87
+ Note: This project has been tested on T4 GPU using 16 GB of RAM.
88
+
89
+ To install Meridian, run the following command to automatically install the
90
+ latest release from PyPI.
91
+
92
+ * For Linux-GPU users:
93
+
94
+ Note: CUDA toolchain and a compatible GPU device is necessary for
95
+ `[and-cuda]` extra to activate.
96
+
97
+ ```sh
98
+ $ pip install --upgrade google-meridian[and-cuda]
99
+ ```
100
+
101
+ * For macOS and general CPU users:
102
+
103
+ Note: There is no official GPU support for macOS.
104
+
105
+ ```sh
106
+ $ pip install --upgrade google-meridian
107
+ ```
108
+
109
+ Alternatively, run the following command to install the most recent, unreleased
110
+ version from GitHub.
111
+
112
+ * For GPU users:
113
+
114
+ ```sh
115
+ $ pip install --upgrade "google-meridian[and-cuda] @ git+https://github.com/google/meridian.git"
116
+ ```
117
+
118
+ * For CPU users:
119
+
120
+ ```sh
121
+ $ pip install --upgrade git+https://github.com/google/meridian.git
122
+ ```
123
+
124
+ We recommend to install Meridian in a fresh
125
+ [virtual environment](https://virtualenv.pypa.io/en/latest/user_guide.html#quick-start)
126
+ to make sure that correct versions of all the dependencies are installed, as
127
+ defined in [pyproject.toml](https://github.com/google/meridian/blob/main/pyproject.toml).
128
+
129
+ ## How to use the Meridian library
130
+
131
+ To get started with Meridian, you can run the code programmatically using sample
132
+ data with the [Getting Started Colab][3].
133
+
134
+ The Meridian model uses a holistic MCMC sampling approach called
135
+ [No U Turn Sampler (NUTS)](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/mcmc/NoUTurnSampler)
136
+ which can be compute intensive. To help with this, GPU support has been
137
+ developed across the library (out-of-the-box) using tensors. We recommend
138
+ running your Meridian model on GPUs to get real time optimization results and
139
+ significantly reduce training time.
140
+
141
+ ## Meridian Documentation & Tutorials
142
+
143
+ The following documentation, colab, and video resources will help you get
144
+ started quickly with using Meridian:
145
+
146
+ | Resource | Description |
147
+ | --------------------------- | ---------------------------------------------- |
148
+ | [Meridian documentation][1] | Main landing page for Meridian documentation. |
149
+ | [Meridian basics][2] | Learn about Meridian features, methodologies, and the model math. |
150
+ | [Getting started colab][3] | Install and quickly learn how to use Meridian with this colab tutorial using sample data. |
151
+ | [User guide][4] | A detailed walk-through of how to use Meridian and generating visualizations using your own data. |
152
+ | [Pre-modeling][5] | Prepare and analyze your data before modeling. |
153
+ | [Modeling][6] | Modeling guidance for model refinement and edge cases. |
154
+ | [Post-modeling][7] | Post-modeling guidance for model fit, visualizations, optimizations, refreshing the model, and debugging. |
155
+ | [Migrate from LMMM][8] | Learn about the differences between Meridian and LightweightMMM as you consider migrating. |
156
+ | [API Reference][9] | API reference documentation for the Meridian package. |
157
+ | [Reference list][10] | White papers and other referenced material. |
158
+
159
+ [1]: https://developers.google.com/meridian
160
+ [2]: https://developers.google.com/meridian/docs/basics/meridian-introduction
161
+ [3]: https://developers.google.com/meridian/notebook/meridian-getting-started
162
+ [4]: https://developers.google.com/meridian/docs/user-guide/installing
163
+ [5]: https://developers.google.com/meridian/docs/pre-modeling/collect-data
164
+ [6]: https://developers.google.com/meridian/docs/advanced-modeling/control-variables
165
+ [7]: https://developers.google.com/meridian/docs/post-modeling/model-fit
166
+ [8]: https://developers.google.com/meridian/docs/migrate
167
+ [9]: https://developers.google.com/meridian/reference/api/meridian
168
+ [10]: https://developers.google.com/meridian/docs/reference-list
169
+
170
+ ## Support
171
+
172
+ **Questions about methodology**: Please see the [Modeling](https://developers.google.com/meridian/docs/basics/meridian-introduction) tab in the technical documentation.
173
+
174
+ **Issues installing or using Meridian**: Feel free to post questions in the
175
+ [Discussions](https://github.com/google/meridian/discussions) or [Issues](https://github.com/google/meridian/issues) tabs of the Meridian GitHub repository. The Meridian team responds to
176
+ these questions weekly in batches, so please be patient and don't reach out
177
+ directly to your Google Account teams.
178
+
179
+ **Bug reports**: Please post bug reports to the [Issues](https://github.com/google/meridian/issues)
180
+ tab of the Meridian GitHub repository. We also encourage the community to share
181
+ tips and advice with each other on the [Issues](https://github.com/google/meridian/issues)
182
+ tab. When our team addresses or resolves a new bug, we will notify you through
183
+ the comments on the issue.
184
+
185
+ **Feature requests**: Please post these to the [Discussions](https://github.com/google/meridian/discussions)
186
+ tab of the Meridian GitHub repository. We have an internal roadmap for Meridian
187
+ development, but would love your inputs for new feature requests so that we can
188
+ prioritize them based on the roadmap.
189
+
190
+ **Pull requests**: These are appreciated but are very difficult for us to merge
191
+ because the code in this repository is linked to Google internal systems and has
192
+ to pass internal review. If you submit a pull request and we believe that we can
193
+ incorporate a change in the base code, we will reach out to you directly about
194
+ this.
195
+
196
+ ## Citing Meridian
197
+
198
+ To cite this repository:
199
+
200
+ <!-- mdlint off(SNIPPET_INVALID_LANGUAGE) -->
201
+ ```BibTeX
202
+ @software{meridian_github,
203
+ author = {Google Meridian Marketing Mix Modeling Team},
204
+ title = {Meridian: Marketing Mix Modeling},
205
+ url = {https://github.com/google/meridian},
206
+ version = {1.3.2},
207
+ year = {2025},
208
+ }
209
+ ```
@@ -151,7 +151,7 @@ To cite this repository:
151
151
  author = {Google Meridian Marketing Mix Modeling Team},
152
152
  title = {Meridian: Marketing Mix Modeling},
153
153
  url = {https://github.com/google/meridian},
154
- version = {1.3.0},
154
+ version = {1.3.2},
155
155
  year = {2025},
156
156
  }
157
157
  ```
@@ -0,0 +1,209 @@
1
+ Metadata-Version: 2.4
2
+ Name: google-meridian
3
+ Version: 1.3.2
4
+ Summary: Google's open source mixed marketing model library, helps you understand your return on investment and direct your ad spend with confidence.
5
+ Author-email: The Meridian Authors <no-reply@google.com>
6
+ Project-URL: homepage, https://github.com/google/meridian
7
+ Project-URL: repository, https://github.com/google/meridian
8
+ Project-URL: changelog, https://github.com/google/meridian/blob/main/CHANGELOG.md
9
+ Project-URL: documentation, https://developers.google.com/meridian
10
+ Keywords: mmm
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Topic :: Other/Nonlisted Topic
14
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: arviz
19
+ Requires-Dist: altair>=5
20
+ Requires-Dist: immutabledict
21
+ Requires-Dist: joblib
22
+ Requires-Dist: natsort<8,>=7.1.1
23
+ Requires-Dist: numpy<3,>=2.0.2
24
+ Requires-Dist: pandas<3,>=2.2.2
25
+ Requires-Dist: patsy<1,>=0.5.3
26
+ Requires-Dist: scipy<2,>=1.13.1
27
+ Requires-Dist: statsmodels>=0.14.5
28
+ Requires-Dist: tensorflow<2.21,>=2.18
29
+ Requires-Dist: tensorflow-probability<0.26,>=0.25
30
+ Requires-Dist: tf-keras<2.21,>=2.18
31
+ Requires-Dist: xarray
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
34
+ Requires-Dist: pytest-xdist; extra == "dev"
35
+ Requires-Dist: pylint>=2.6.0; extra == "dev"
36
+ Requires-Dist: pyink; extra == "dev"
37
+ Provides-Extra: colab
38
+ Requires-Dist: psutil; extra == "colab"
39
+ Requires-Dist: python-calamine; extra == "colab"
40
+ Provides-Extra: and-cuda
41
+ Requires-Dist: tensorflow[and-cuda]<2.21,>=2.18; extra == "and-cuda"
42
+ Provides-Extra: mlflow
43
+ Requires-Dist: mlflow; extra == "mlflow"
44
+ Provides-Extra: jax
45
+ Requires-Dist: jax==0.5.3; extra == "jax"
46
+ Requires-Dist: jaxlib==0.5.3; extra == "jax"
47
+ Requires-Dist: tensorflow-probability[substrates-jax]==0.25.0; extra == "jax"
48
+ Provides-Extra: schema
49
+ Requires-Dist: mmm-proto-schema; extra == "schema"
50
+ Requires-Dist: semver; extra == "schema"
51
+ Dynamic: license-file
52
+
53
+ # About Meridian
54
+
55
+ Marketing mix modeling (MMM) is a statistical analysis technique that measures
56
+ the impact of marketing campaigns and activities to guide budget planning
57
+ decisions and improve overall media effectiveness. MMM uses aggregated data to
58
+ measure impact across marketing channels and account for non-marketing factors
59
+ that impact sales and other key performance indicators (KPIs). MMM is
60
+ privacy-safe and does not use any cookie or user-level information.
61
+
62
+ Meridian is an MMM framework that enables advertisers to set up and run their
63
+ own in-house models. Meridian helps you answer key questions such as:
64
+
65
+ * How did the marketing channels drive my revenue or other KPI?
66
+ * What was my marketing return on investment (ROI)?
67
+ * How do I optimize my marketing budget allocation for the future?
68
+
69
+ Meridian is a highly customizable modeling framework that is based on
70
+ [Bayesian causal inference](https://developers.google.com/meridian/docs/causal-inference/bayesian-inference).
71
+ It is capable of handling large scale geo-level data, which is encouraged if
72
+ available, but it can also be used for national-level modeling. Meridian
73
+ provides clear insights and visualizations to inform business decisions around
74
+ marketing budget and planning. Additionally, Meridian provides methodologies to
75
+ support calibration of MMM with experiments and other prior information, and to
76
+ optimize target ad frequency by utilizing reach and frequency data.
77
+
78
+ If you are using LightweightMMM, see the
79
+ [migration guide](https://developers.google.com/meridian/docs/migrate) to help
80
+ you understand the differences between these MMM projects.
81
+
82
+ ## Install Meridian
83
+
84
+ Python 3.11 or 3.12 is required to use Meridian. We also recommend using a
85
+ minimum of 1 GPU.
86
+
87
+ Note: This project has been tested on T4 GPU using 16 GB of RAM.
88
+
89
+ To install Meridian, run the following command to automatically install the
90
+ latest release from PyPI.
91
+
92
+ * For Linux-GPU users:
93
+
94
+ Note: CUDA toolchain and a compatible GPU device is necessary for
95
+ `[and-cuda]` extra to activate.
96
+
97
+ ```sh
98
+ $ pip install --upgrade google-meridian[and-cuda]
99
+ ```
100
+
101
+ * For macOS and general CPU users:
102
+
103
+ Note: There is no official GPU support for macOS.
104
+
105
+ ```sh
106
+ $ pip install --upgrade google-meridian
107
+ ```
108
+
109
+ Alternatively, run the following command to install the most recent, unreleased
110
+ version from GitHub.
111
+
112
+ * For GPU users:
113
+
114
+ ```sh
115
+ $ pip install --upgrade "google-meridian[and-cuda] @ git+https://github.com/google/meridian.git"
116
+ ```
117
+
118
+ * For CPU users:
119
+
120
+ ```sh
121
+ $ pip install --upgrade git+https://github.com/google/meridian.git
122
+ ```
123
+
124
+ We recommend to install Meridian in a fresh
125
+ [virtual environment](https://virtualenv.pypa.io/en/latest/user_guide.html#quick-start)
126
+ to make sure that correct versions of all the dependencies are installed, as
127
+ defined in [pyproject.toml](https://github.com/google/meridian/blob/main/pyproject.toml).
128
+
129
+ ## How to use the Meridian library
130
+
131
+ To get started with Meridian, you can run the code programmatically using sample
132
+ data with the [Getting Started Colab][3].
133
+
134
+ The Meridian model uses a holistic MCMC sampling approach called
135
+ [No U Turn Sampler (NUTS)](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/mcmc/NoUTurnSampler)
136
+ which can be compute intensive. To help with this, GPU support has been
137
+ developed across the library (out-of-the-box) using tensors. We recommend
138
+ running your Meridian model on GPUs to get real time optimization results and
139
+ significantly reduce training time.
140
+
141
+ ## Meridian Documentation & Tutorials
142
+
143
+ The following documentation, colab, and video resources will help you get
144
+ started quickly with using Meridian:
145
+
146
+ | Resource | Description |
147
+ | --------------------------- | ---------------------------------------------- |
148
+ | [Meridian documentation][1] | Main landing page for Meridian documentation. |
149
+ | [Meridian basics][2] | Learn about Meridian features, methodologies, and the model math. |
150
+ | [Getting started colab][3] | Install and quickly learn how to use Meridian with this colab tutorial using sample data. |
151
+ | [User guide][4] | A detailed walk-through of how to use Meridian and generating visualizations using your own data. |
152
+ | [Pre-modeling][5] | Prepare and analyze your data before modeling. |
153
+ | [Modeling][6] | Modeling guidance for model refinement and edge cases. |
154
+ | [Post-modeling][7] | Post-modeling guidance for model fit, visualizations, optimizations, refreshing the model, and debugging. |
155
+ | [Migrate from LMMM][8] | Learn about the differences between Meridian and LightweightMMM as you consider migrating. |
156
+ | [API Reference][9] | API reference documentation for the Meridian package. |
157
+ | [Reference list][10] | White papers and other referenced material. |
158
+
159
+ [1]: https://developers.google.com/meridian
160
+ [2]: https://developers.google.com/meridian/docs/basics/meridian-introduction
161
+ [3]: https://developers.google.com/meridian/notebook/meridian-getting-started
162
+ [4]: https://developers.google.com/meridian/docs/user-guide/installing
163
+ [5]: https://developers.google.com/meridian/docs/pre-modeling/collect-data
164
+ [6]: https://developers.google.com/meridian/docs/advanced-modeling/control-variables
165
+ [7]: https://developers.google.com/meridian/docs/post-modeling/model-fit
166
+ [8]: https://developers.google.com/meridian/docs/migrate
167
+ [9]: https://developers.google.com/meridian/reference/api/meridian
168
+ [10]: https://developers.google.com/meridian/docs/reference-list
169
+
170
+ ## Support
171
+
172
+ **Questions about methodology**: Please see the [Modeling](https://developers.google.com/meridian/docs/basics/meridian-introduction) tab in the technical documentation.
173
+
174
+ **Issues installing or using Meridian**: Feel free to post questions in the
175
+ [Discussions](https://github.com/google/meridian/discussions) or [Issues](https://github.com/google/meridian/issues) tabs of the Meridian GitHub repository. The Meridian team responds to
176
+ these questions weekly in batches, so please be patient and don't reach out
177
+ directly to your Google Account teams.
178
+
179
+ **Bug reports**: Please post bug reports to the [Issues](https://github.com/google/meridian/issues)
180
+ tab of the Meridian GitHub repository. We also encourage the community to share
181
+ tips and advice with each other on the [Issues](https://github.com/google/meridian/issues)
182
+ tab. When our team addresses or resolves a new bug, we will notify you through
183
+ the comments on the issue.
184
+
185
+ **Feature requests**: Please post these to the [Discussions](https://github.com/google/meridian/discussions)
186
+ tab of the Meridian GitHub repository. We have an internal roadmap for Meridian
187
+ development, but would love your inputs for new feature requests so that we can
188
+ prioritize them based on the roadmap.
189
+
190
+ **Pull requests**: These are appreciated but are very difficult for us to merge
191
+ because the code in this repository is linked to Google internal systems and has
192
+ to pass internal review. If you submit a pull request and we believe that we can
193
+ incorporate a change in the base code, we will reach out to you directly about
194
+ this.
195
+
196
+ ## Citing Meridian
197
+
198
+ To cite this repository:
199
+
200
+ <!-- mdlint off(SNIPPET_INVALID_LANGUAGE) -->
201
+ ```BibTeX
202
+ @software{meridian_github,
203
+ author = {Google Meridian Marketing Mix Modeling Team},
204
+ title = {Meridian: Marketing Mix Modeling},
205
+ url = {https://github.com/google/meridian},
206
+ version = {1.3.2},
207
+ year = {2025},
208
+ }
209
+ ```
@@ -13,7 +13,6 @@ meridian/constants.py
13
13
  meridian/version.py
14
14
  meridian/analysis/__init__.py
15
15
  meridian/analysis/analyzer.py
16
- meridian/analysis/formatter.py
17
16
  meridian/analysis/optimizer.py
18
17
  meridian/analysis/summarizer.py
19
18
  meridian/analysis/summary_text.py
@@ -25,14 +24,6 @@ meridian/analysis/review/configs.py
25
24
  meridian/analysis/review/constants.py
26
25
  meridian/analysis/review/results.py
27
26
  meridian/analysis/review/reviewer.py
28
- meridian/analysis/templates/card.html.jinja
29
- meridian/analysis/templates/chart.html.jinja
30
- meridian/analysis/templates/chips.html.jinja
31
- meridian/analysis/templates/insights.html.jinja
32
- meridian/analysis/templates/stats.html.jinja
33
- meridian/analysis/templates/style.scss
34
- meridian/analysis/templates/summary.html.jinja
35
- meridian/analysis/templates/table.html.jinja
36
27
  meridian/backend/__init__.py
37
28
  meridian/backend/config.py
38
29
  meridian/backend/test_utils.py
@@ -63,4 +54,27 @@ meridian/model/eda/constants.py
63
54
  meridian/model/eda/eda_engine.py
64
55
  meridian/model/eda/eda_outcome.py
65
56
  meridian/model/eda/eda_spec.py
66
- meridian/model/eda/meridian_eda.py
57
+ meridian/templates/card.html.jinja
58
+ meridian/templates/chart.html.jinja
59
+ meridian/templates/chips.html.jinja
60
+ meridian/templates/formatter.py
61
+ meridian/templates/formatter_test.py
62
+ meridian/templates/insights.html.jinja
63
+ meridian/templates/stats.html.jinja
64
+ meridian/templates/style.scss
65
+ meridian/templates/summary.html.jinja
66
+ meridian/templates/table.html.jinja
67
+ schema/__init__.py
68
+ schema/serde/__init__.py
69
+ schema/serde/constants.py
70
+ schema/serde/distribution.py
71
+ schema/serde/eda_spec.py
72
+ schema/serde/function_registry.py
73
+ schema/serde/hyperparameters.py
74
+ schema/serde/inference_data.py
75
+ schema/serde/marketing_data.py
76
+ schema/serde/meridian_serde.py
77
+ schema/serde/serde.py
78
+ schema/serde/test_data.py
79
+ schema/utils/__init__.py
80
+ schema/utils/time_record.py
@@ -8,13 +8,13 @@ pandas<3,>=2.2.2
8
8
  patsy<1,>=0.5.3
9
9
  scipy<2,>=1.13.1
10
10
  statsmodels>=0.14.5
11
- tensorflow<2.19,>=2.18
11
+ tensorflow<2.21,>=2.18
12
12
  tensorflow-probability<0.26,>=0.25
13
- tf-keras<2.19,>=2.18
13
+ tf-keras<2.21,>=2.18
14
14
  xarray
15
15
 
16
16
  [and-cuda]
17
- tensorflow[and-cuda]<2.19,>=2.18
17
+ tensorflow[and-cuda]<2.21,>=2.18
18
18
 
19
19
  [colab]
20
20
  psutil
@@ -27,9 +27,13 @@ pylint>=2.6.0
27
27
  pyink
28
28
 
29
29
  [jax]
30
- jax==0.4.26
31
- jaxlib==0.4.26
30
+ jax==0.5.3
31
+ jaxlib==0.5.3
32
32
  tensorflow-probability[substrates-jax]==0.25.0
33
33
 
34
34
  [mlflow]
35
35
  mlflow
36
+
37
+ [schema]
38
+ mmm-proto-schema
39
+ semver
@@ -15,9 +15,8 @@
15
15
  """Meridian analysis API for trained models."""
16
16
 
17
17
  from meridian.analysis import analyzer
18
- from meridian.analysis import formatter
19
18
  from meridian.analysis import optimizer
20
19
  from meridian.analysis import review
21
20
  from meridian.analysis import summarizer
22
21
  from meridian.analysis import visualizer
23
-
22
+ from meridian.templates import formatter
@@ -53,7 +53,6 @@ def _validate_non_media_baseline_values_numbers(
53
53
  )
54
54
 
55
55
 
56
- # TODO: Refactor the related unit tests to be under DataTensors.
57
56
  @dataclasses.dataclass
58
57
  class DataTensors(backend.ExtensionType):
59
58
  """Container for data variable arguments of Analyzer methods.
@@ -27,10 +27,10 @@ import jinja2
27
27
  from meridian import backend
28
28
  from meridian import constants as c
29
29
  from meridian.analysis import analyzer as analyzer_module
30
- from meridian.analysis import formatter
31
30
  from meridian.analysis import summary_text
32
31
  from meridian.data import time_coordinates as tc
33
32
  from meridian.model import model
33
+ from meridian.templates import formatter
34
34
  import numpy as np
35
35
  import pandas as pd
36
36
  import xarray as xr
@@ -1174,10 +1174,12 @@ class OptimizationResults:
1174
1174
  diff = self.optimized_data.total_cpik - self.nonoptimized_data.total_cpik
1175
1175
  non_optimized_performance_title = summary_text.NON_OPTIMIZED_CPIK_LABEL
1176
1176
  non_optimized_performance_stat = (
1177
- f'${self.nonoptimized_data.total_cpik:.2f}'
1177
+ f'{currency}{self.nonoptimized_data.total_cpik:.2f}'
1178
1178
  )
1179
1179
  optimized_performance_title = summary_text.OPTIMIZED_CPIK_LABEL
1180
- optimized_performance_stat = f'${self.optimized_data.total_cpik:.2f}'
1180
+ optimized_performance_stat = (
1181
+ f'{currency}{self.optimized_data.total_cpik:.2f}'
1182
+ )
1181
1183
  optimized_performance_diff = formatter.compact_number(diff, 2, currency)
1182
1184
  non_optimized_performance = formatter.StatsSpec(
1183
1185
  title=non_optimized_performance_title,