Skip to content

Commit d9eef74

Browse files
committed
Align casing of NumPyro with canonical spelling
1 parent 804aa4a commit d9eef74

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Taking a Bayesian approach to MMM allows an advertiser to integrate prior inform
3030
- Report on both parameter and model uncertainty and propagate it to your budget optimisation.
3131
- Construct hierarchical models, with generally tighter credible intervals, using breakout dimensions such as geography.
3232

33-
The LightweightMMM package (built using [Numpyro](https://github.com/pyro-ppl/numpyro) and [JAX](https://github.com/google/jax)) helps advertisers easily build Bayesian MMM models by providing the functionality to appropriately scale data, evaluate models, optimise budget allocations and plot common graphs used in the field.
33+
The LightweightMMM package (built using [NumPyro](https://github.com/pyro-ppl/numpyro) and [JAX](https://github.com/google/jax)) helps advertisers easily build Bayesian MMM models by providing the functionality to appropriately scale data, evaluate models, optimise budget allocations and plot common graphs used in the field.
3434

3535
## Theory
3636

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ library that allows users to easily train MMMs and obtain channel attribution
88
information. The library also includes capabilities for optimizing media
99
allocation as well as plotting common graphs in the field.
1010

11-
It is built in python3 and makes use of Numpyro and JAX.
11+
It is built in python3 and makes use of NumPyro and JAX.
1212

1313
Installation
1414
------------

lightweight_mmm/core/transformations/lagging.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def carryover(
9595
custom_priors: The custom priors we want the model to take instead of the
9696
default ones.
9797
number_lags: Number of lags for the carryover function.
98-
prefix: Prefix to use in the variable name for Numpyro.
98+
prefix: Prefix to use in the variable name for NumPyro.
9999
100100
Returns:
101101
The transformed media data.
@@ -178,7 +178,7 @@ def adstock(
178178
default ones. The possible names of parameters for adstock and exponent
179179
are "lag_weight" and "exponent".
180180
normalise: Whether to normalise the output values.
181-
prefix: Prefix to use in the variable name for Numpyro.
181+
prefix: Prefix to use in the variable name for NumPyro.
182182
183183
Returns:
184184
The transformed media data.

lightweight_mmm/core/transformations/saturation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def hill(
6262
custom_priors: The custom priors we want the model to take instead of the
6363
default ones. The possible names of parameters for hill_adstock and
6464
exponent are "lag_weight", "half_max_effective_concentration" and "slope".
65-
prefix: Prefix to use in the variable name for Numpyro.
65+
prefix: Prefix to use in the variable name for NumPyro.
6666
6767
Returns:
6868
The transformed media data.
@@ -112,7 +112,7 @@ def exponent(
112112
national models and 3 for geo models.
113113
custom_priors: The custom priors we want the model to take instead of the
114114
default ones.
115-
prefix: Prefix to use in the variable name for Numpyro.
115+
prefix: Prefix to use in the variable name for NumPyro.
116116
117117
Returns:
118118
The transformed media data.

lightweight_mmm/lightweight_mmm.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,17 @@ def _create_list_of_attributes_to_compare(
214214
def _preprocess_custom_priors(
215215
self,
216216
custom_priors: Dict[str, Prior]) -> MutableMapping[str, Prior]:
217-
"""Preprocesses the user input custom priors to Numpyro distributions.
217+
"""Preprocesses the user input custom priors to NumPyro distributions.
218218
219-
If numpyro distributions are given they remains untouched, however if any
219+
If NumPyro distributions are given they remains untouched, however if any
220220
other option is passed, it is passed to the default distribution to alter
221221
its constructor values.
222222
223223
Args:
224224
custom_priors: Mapping of the name of the prior to its custom value.
225225
226226
Returns:
227-
A mapping of names to numpyro distributions based on user input and
227+
A mapping of names to NumPyro distributions based on user input and
228228
default values.
229229
"""
230230
default_priors = {
@@ -246,8 +246,8 @@ def _preprocess_custom_priors(
246246
**custom_priors[prior_name])
247247
elif not isinstance(custom_priors[prior_name], dist.Distribution):
248248
raise ValueError(
249-
"Priors given must be a Numpyro distribution or one of the "
250-
"following to fit in the constructor of our default Numpyro "
249+
"Priors given must be a NumPyro distribution or one of the "
250+
"following to fit in the constructor of our default NumPyro "
251251
"distribution. It could be given as args or kwargs as long as it "
252252
"is the correct format for such object. Please refer to our "
253253
"documentation on custom priors to know more.")
@@ -295,7 +295,7 @@ def fit(
295295
number_chains: Number of chains to sample. Default is 2.
296296
target_accept_prob: Target acceptance probability for step size in the
297297
NUTS sampler. Default is .85.
298-
init_strategy: Initialization function for numpyro NUTS. The available
298+
init_strategy: Initialization function for NumPyro NUTS. The available
299299
options can be found in
300300
https://num.pyro.ai/en/stable/utilities.html#initialization-strategies.
301301
Default is numpyro.infer.init_to_median.
@@ -395,7 +395,7 @@ def fit(
395395
logging.info("Model has been fitted")
396396

397397
def print_summary(self) -> None:
398-
"""Calls print_summary function from numpyro to print parameters summary.
398+
"""Calls print_summary function from NumPyro to print parameters summary.
399399
"""
400400
# TODO(): add name selection for print.
401401
self._mcmc.print_summary()
@@ -431,7 +431,7 @@ def _predict(
431431
frequency: Frequency of the seasonality.
432432
transform_function: Media transform function to use within the model.
433433
weekday_seasonality: Allow daily weekday estimation.
434-
model: Numpyro model to use for numpyro.infer.Predictive.
434+
model: NumPyro model to use for numpyro.infer.Predictive.
435435
posterior_samples: Mapping of the posterior samples.
436436
custom_priors: The custom priors we want the model to take instead of the
437437
default ones. Refer to the full documentation on custom priors for

lightweight_mmm/lightweight_mmm_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def test_fit_with_custom_prior_raises_valueerror_if_wrong_format(
210210

211211
with self.assertRaisesRegex(
212212
ValueError,
213-
"Priors given must be a Numpyro distribution or one of the "):
213+
"Priors given must be a NumPyro distribution or one of the "):
214214
mmm_object.fit(
215215
media=media,
216216
target=target,

0 commit comments

Comments
 (0)