Skip to content

Commit

Permalink
Improve and sync the README and landing page. (pymc-labs#978)
Browse files Browse the repository at this point in the history
* add table

* sync index

* empty

* improvements
  • Loading branch information
juanitorduz authored and radiokosmos committed Sep 1, 2024
1 parent 272f3f7 commit 1ae6255
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 37 deletions.
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,19 @@ We provide a `Dockerfile` to build a Docker image for PyMC-Marketing so that is

Leverage our Bayesian MMM API to tailor your marketing strategies effectively. Leveraging on top of the research article [Jin, Yuxue, et al. “Bayesian methods for media mix modeling with carryover and shape effects.” (2017)](https://research.google/pubs/pub46001/), and extending it by integrating the expertise from core PyMC developers, our API provides:

- **Custom Priors and Likelihoods**: Tailor your model to your specific business needs by including domain knowledge via prior distributions.
- **Adstock Transformation**: Optimize the carry-over effects in your marketing channels.
- **Saturation Effects**: Understand the diminishing returns in media investments.
- **Customize adstock and saturation functions:** You can select from a variety of adstock and saturation functions. You can even implement your own custom functions.
- **Time-varying Intercept:** Capture time-varying baseline contributions in your model (using modern and efficient Gaussian processes approximation methods).
- **Time-varying Media Contribution:** Capture time-varying media efficiency in your model (using modern and efficient Gaussian processes approximation methods).
- **Visualization and Model Diagnostics**: Get a comprehensive view of your model's performance and insights.
- **Choose among many inference algorithms**: We provide the option to choose between various NUTS samplers (e.g. BlackJax, NumPyro and Nutpie). See the [example notebook](https://www.pymc-marketing.io/en/stable/notebooks/general/other_nuts_samplers.html) for more details.
- **Out-of-sample Predictions**: Forecast future marketing performance with credible intervals. Use this for simulations and scenario planning.
- **Budget Optimization**: Allocate your marketing spend efficiently across various channels for maximum ROI.
- **Experiment Calibration**: Fine-tune your model based on empirical experiments for a more unified view of marketing.
| Feature | Description |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Custom Priors and Likelihoods | Tailor your model to your specific business needs by including domain knowledge via prior distributions. |
| Adstock Transformation | Optimize the carry-over effects in your marketing channels. |
| Saturation Effects | Understand the diminishing returns in media investments. |
| Customize adstock and saturation functions | You can select from a variety of adstock and saturation functions. You can even implement your own custom functions. See [documentation guide](https://www.pymc-marketing.io/en/stable/notebooks/mmm/mmm_components.html). |
| Time-varying Intercept | Capture time-varying baseline contributions in your model (using modern and efficient Gaussian processes approximation methods). See [guide notebook](https://www.pymc-marketing.io/en/stable/notebooks/mmm/mmm_time_varying_media_example.html). |
| Time-varying Media Contribution | Capture time-varying media efficiency in your model (using modern and efficient Gaussian processes approximation methods). See the [guide notebook](https://www.pymc-marketing.io/en/stable/notebooks/mmm/mmm_tvp_example.html). |
| Visualization and Model Diagnostics | Get a comprehensive view of your model's performance and insights. |
| Choose among many inference algorithms | We provide the option to choose between various NUTS samplers (e.g. BlackJax, NumPyro and Nutpie). See the [example notebook](https://www.pymc-marketing.io/en/stable/notebooks/general/other_nuts_samplers.html) for more details. |
| Out-of-sample Predictions | Forecast future marketing performance with credible intervals. Use this for simulations and scenario planning. |
| Budget Optimization | Allocate your marketing spend efficiently across various channels for maximum ROI. See the [budget optimization example notebook](https://www.pymc-marketing.io/en/stable/notebooks/mmm/mmm_budget_allocation_example.html) |
| Experiment Calibration | Fine-tune your model based on empirical experiments for a more unified view of marketing. See the [lift test integration explanation](https://www.pymc-marketing.io/en/stable/notebooks/mmm/mmm_lift_test.html) for more details. [Here](https://www.pymc-marketing.io/en/stable/notebooks/mmm/mmm_roas.html) you can find a *Case Study: Unobserved Confounders, ROAS and Lift Tests*. |

### MMM Quickstart

Expand Down Expand Up @@ -140,10 +142,10 @@ Explore our detailed CLV examples using data from the [`lifetimes`](https://gith

### Examples

| | **Non-contractual** | **Contractual** |
|----------------|---------------------|--------------------------------|
| **Continuous** | online purchases | ad conversion time |
| **Discrete** | concerts & sports events | recurring subscriptions |
| | **Non-contractual** | **Contractual** |
| -------------- | ------------------------ | ----------------------- |
| **Continuous** | online purchases | ad conversion time |
| **Discrete** | concerts & sports events | recurring subscriptions |

### CLV Quickstart

Expand Down
71 changes: 49 additions & 22 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,42 @@ To the reference guide
::::
:::::

## In-depth Bayesian Marketing Mix Modeling (MMM) in PyMC

Leverage our Bayesian MMM API to tailor your marketing strategies effectively. Leveraging on top of the research article [Jin, Yuxue, et al. “Bayesian methods for media mix modeling with carryover and shape effects.” (2017)](https://research.google/pubs/pub46001/), and extending it by integrating the expertise from core PyMC developers, our API provides:

| Feature | Description |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Custom Priors and Likelihoods | Tailor your model to your specific business needs by including domain knowledge via prior distributions. |
| Adstock Transformation | Optimize the carry-over effects in your marketing channels. |
| Saturation Effects | Understand the diminishing returns in media investments. |
| Customize adstock and saturation functions | You can select from a variety of adstock and saturation functions. You can even implement your own custom functions. See [documentation guide](https://www.pymc-marketing.io/en/stable/notebooks/mmm/mmm_components.html). |
| Time-varying Intercept | Capture time-varying baseline contributions in your model (using modern and efficient Gaussian processes approximation methods). See [guide notebook](https://www.pymc-marketing.io/en/stable/notebooks/mmm/mmm_time_varying_media_example.html). |
| Time-varying Media Contribution | Capture time-varying media efficiency in your model (using modern and efficient Gaussian processes approximation methods). See the [guide notebook](https://www.pymc-marketing.io/en/stable/notebooks/mmm/mmm_tvp_example.html). |
| Visualization and Model Diagnostics | Get a comprehensive view of your model's performance and insights. |
| Choose among many inference algorithms | We provide the option to choose between various NUTS samplers (e.g. BlackJax, NumPyro and Nutpie). See the [example notebook](https://www.pymc-marketing.io/en/stable/notebooks/general/other_nuts_samplers.html) for more details. |
| Out-of-sample Predictions | Forecast future marketing performance with credible intervals. Use this for simulations and scenario planning. |
| Budget Optimization | Allocate your marketing spend efficiently across various channels for maximum ROI. See the [budget optimization example notebook](https://www.pymc-marketing.io/en/stable/notebooks/mmm/mmm_budget_allocation_example.html) |
| Experiment Calibration | Fine-tune your model based on empirical experiments for a more unified view of marketing. See the [lift test integration explanation](https://www.pymc-marketing.io/en/stable/notebooks/mmm/mmm_lift_test.html) for more details. [Here](https://www.pymc-marketing.io/en/stable/notebooks/mmm/mmm_roas.html) you can find a *Case Study: Unobserved Confounders, ROAS and Lift Tests*. |

## Unlock Customer Lifetime Value (CLV) with PyMC

Understand and optimize your customer's value with our **CLV models**. Our API supports various types of CLV models, catering to both contractual and non-contractual settings, as well as continuous and discrete transaction modes.

Explore our detailed CLV examples using data from the [`lifetimes`](https://github.com/CamDavidsonPilon/lifetimes) package:

- [CLV Quickstart](https://pymc-marketing.readthedocs.io/en/stable/notebooks/clv/clv_quickstart.html)
- [BG/NBD model](https://pymc-marketing.readthedocs.io/en/stable/notebooks/clv/bg_nbd.html)
- [Pareto/NBD model](https://pymc-marketing.readthedocs.io/en/stable/notebooks/clv/pareto_nbd.html)
- [Gamma-Gamma model](https://pymc-marketing.readthedocs.io/en/stable/notebooks/clv/gamma_gamma.html)

### Examples

| | **Non-contractual** | **Contractual** |
| -------------- | ------------------------ | ----------------------- |
| **Continuous** | online purchases | ad conversion time |
| **Discrete** | concerts & sports events | recurring subscriptions |

## Installation

Install and activate an environment (e.g. `marketing_env`) with the `pymc-marketing` package from [conda-forge](https://conda-forge.org). It may look something like the following:
Expand Down Expand Up @@ -118,9 +154,8 @@ from pymc_marketing.mmm import (
MMM,
)


data_url = "https://raw.githubusercontent.com/pymc-labs/pymc-marketing/main/data/mmm_example.csv"
data = pd.read_csv(data_url, parse_dates=['date_week'])
data = pd.read_csv(data_url, parse_dates=["date_week"])

mmm = MMM(
adstock=GeometricAdstock(l_max=8),
Expand All @@ -136,45 +171,37 @@ mmm = MMM(
)
```

Initiate fitting and get a visualization of some of the outputs with:
Once the model is fitted, we can further optimize our budget allocation as we are including diminishing returns and carry-over effects in our model.

```python
X = data.drop("y",axis=1)
y = data["y"]
mmm.fit(X,y)
mmm.plot_components_contributions();
```
<center>
<img src="/docs/source/_static/mmm_plot_plot_channel_contributions_grid.png" width="80%" />
</center>

See the Example notebooks section for examples of further types of plot you can get, as well as introspect the results of the fitting.
Explore a hands-on [simulated example](https://pymc-marketing.readthedocs.io/en/stable/notebooks/mmm/mmm_example.html) for more insights into MMM with PyMC-Marketing.

### CLV Quickstart

Understand and optimize your customer's value with our **CLV models**. Our API supports various types of models catering to both contractual and non-contractual settings, as well as continuous and discrete transaction modes. Here are some examples:
### CLV Quickstart

| | **Non-contractual** | **Contractual** |
|----------------|---------------------|--------------------------------|
| **Continuous** | online purchases | ad conversion time |
| **Discrete** | concerts & sports events | recurring subscriptions |
We can choose from a variety of models, depending on the type of data and business nature. Let us look into a simple example with the Beta-Geo/NBD model for non-contractual continuous data.

```python
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from pymc_marketing import clv


data_url = "https://raw.githubusercontent.com/pymc-labs/pymc-marketing/main/data/clv_quickstart.csv"
data = pd.read_csv(data_url)
data['customer_id'] = data.index
data["customer_id"] = data.index

beta_geo_model = clv.BetaGeoModel(
data = data
)
beta_geo_model = clv.BetaGeoModel(data=data)

beta_geo_model.fit()
```

After fitting, we predict future purchasing behavior and churn probabilities. See the "How-to" section for detailed examples.
Once fitted, we can use the model to predict the number of future purchases for known customers, the probability that they are still alive, and get various visualizations plotted.

See the {ref}`howto` section for more on this.

## 📞 Schedule a Free Consultation for MMM & CLV Strategy

Expand Down

0 comments on commit 1ae6255

Please sign in to comment.