Skip to content

Migrate to prior module from pymc-extras #1767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"
- name: Build the sdist and the wheel
run: |
pip install build
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
repository-url: https://test.pypi.org/legacy/
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"
- name: Test pip install from test.pypi
run: |
python -m venv venv-test-pypi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
config: [ {python-version: "3.10", oldest-pymc: false}, {python-version: "3.12", oldest-pymc: true}]
config: [ {python-version: "3.11", oldest-pymc: false}, {python-version: "3.13", oldest-pymc: true}]
split:
- "--ignore tests/mmm --ignore tests/clv"
- "tests/mmm --ignore tests/mmm/test_tvp.py --ignore tests/mmm/test_budget_optimizer.py --ignore tests/mmm/test_hsgp.py --ignore tests/mmm/test_transformers.py"
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/uml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.13"

- name: Configure Git Identity
run: |
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ sphinx:
configuration: docs/source/conf.py

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.10"
python: "3.11"
jobs:
pre_build:
# Install core dependencies first
Expand Down
2 changes: 1 addition & 1 deletion docs/source/guide/benefits/model_deployment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"from pymc_extras.prior import Prior\n",
"\n",
"from pymc_marketing.mmm import MMM, GeometricAdstock, LogisticSaturation\n",
"from pymc_marketing.prior import Prior\n",
"\n",
"az.style.use(\"arviz-darkgrid\")\n",
"plt.rcParams[\"figure.figsize\"] = [12, 7]\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/notebooks/bass/bass_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@
"import pandas as pd\n",
"import pymc as pm\n",
"import xarray as xr\n",
"from pymc_extras.prior import Prior, Scaled\n",
"\n",
"from pymc_marketing.bass.model import create_bass_model\n",
"from pymc_marketing.plot import plot_curve\n",
"from pymc_marketing.prior import Prior, Scaled\n",
"\n",
"az.style.use(\"arviz-darkgrid\")\n",
"plt.rcParams[\"figure.figsize\"] = [12, 7]\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/source/notebooks/clv/clv_quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
"import numpy as np\n",
"import pandas as pd\n",
"from arviz.labels import MapLabeller\n",
"from pymc_extras.prior import Prior\n",
"\n",
"from pymc_marketing import clv\n",
"from pymc_marketing.prior import Prior"
"from pymc_marketing import clv"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/source/notebooks/clv/dev/beta_geo_beta_binom.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"\n",
"import pymc as pm\n",
"from pymc_marketing.clv import BetaGeoBetaBinomModel\n",
"from pymc_marketing.prior import Prior"
"from pymc_extras.prior import Prior"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"from fastprogress.fastprogress import progress_bar\n",
"\n",
"from pymc_marketing import clv\n",
"from pymc_marketing.prior import Prior\n",
"from pymc_extras.prior import Prior\n",
"\n",
"from tests.conftest import set_model_fit\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/notebooks/clv/dev/utilities_plotting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"\n",
"from pymc_marketing.clv import utils\n",
"from pymc_marketing.clv import ParetoNBDModel\n",
"from pymc_marketing.prior import Prior\n",
"from pymc_extras.prior import Prior\n",
"\n",
"from pymc_marketing.clv import utils, plotting"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/source/notebooks/clv/pareto_nbd.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"import xarray as xr\n",
"from fastprogress.fastprogress import progress_bar\n",
"from lifetimes import ParetoNBDFitter\n",
"from pymc_extras.prior import Prior\n",
"\n",
"from pymc_marketing import clv\n",
"from pymc_marketing.prior import Prior\n",
"\n",
"# Plotting configuration\n",
"az.style.use(\"arviz-darkgrid\")\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/source/notebooks/general/model_configuration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"import numpy as np\n",
"import pandas as pd\n",
"import pymc as pm\n",
"from pymc_extras.prior import Prior\n",
"\n",
"from pymc_marketing.model_config import ModelConfigError, parse_model_config\n",
"from pymc_marketing.prior import Prior\n",
"\n",
"az.style.use(\"arviz-darkgrid\")\n",
"plt.rcParams[\"figure.figsize\"] = [12, 7]\n",
Expand Down Expand Up @@ -62,7 +62,7 @@
"source": [
"## Prior Distributions\n",
"\n",
"The {class}`~pymc_marketing.prior.Prior` class is our way to expression distributions and relationships between them.\n",
"The {class}`~pymc_extras.prior.Prior` class is our way to expression distributions and relationships between them.\n",
"\n",
"### Basic Usage\n",
"\n",
Expand Down
8 changes: 4 additions & 4 deletions docs/source/notebooks/general/prior_predictive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"(prior_predictive)=\n",
"# Prior Predictive Modeling\n",
"\n",
"This guide provides an introduction to prior predictive modeling using PyMC (and PyMC-Marketing) and the {class}`Prior <pymc_marketing.prior.Prior>` class from PyMC-Marketing. We start by looking into a simpler example and then we will see how to apply to real case scenarios with marketing mix models in PyMC-Marketing.\n",
"This guide provides an introduction to prior predictive modeling using PyMC (and PyMC-Marketing) and the {class}`Prior <pymc_extras.prior.Prior>` class from PyMC-Marketing. We start by looking into a simpler example and then we will see how to apply to real case scenarios with marketing mix models in PyMC-Marketing.\n",
"\n",
"\n",
"Before diving into the technical details, let's understand why priors are crucial in Bayesian analysis and their practical importance in industry applications.\n",
Expand Down Expand Up @@ -135,7 +135,7 @@
"3. **Model Sensitivity**: \n",
" The relationship between $\\theta^{(s)}$ and $y^{(s)}$ shows how parameters influence predictions\n",
"\n",
"Let's explore these concepts through practical examples using the {class}`Prior <pymc_marketing.prior.Prior>` class from PyMC-Marketing.\n"
"Let's explore these concepts through practical examples using the {class}`Prior <pymc_extras.prior.Prior>` class from PyMC-Marketing.\n"
]
},
{
Expand All @@ -161,11 +161,11 @@
"import pymc as pm\n",
"import seaborn as sns\n",
"from numpy.typing import NDArray\n",
"from pymc_extras.prior import Prior\n",
"\n",
"from pymc_marketing.hsgp_kwargs import HSGPKwargs\n",
"from pymc_marketing.mmm import MMM, GeometricAdstock, LogisticSaturation\n",
"from pymc_marketing.paths import data_dir\n",
"from pymc_marketing.prior import Prior\n",
"\n",
"seed: int = sum(map(ord, \"prior\"))\n",
"rng: np.random.Generator = np.random.default_rng(seed=seed)\n",
Expand Down Expand Up @@ -1975,7 +1975,7 @@
"## Key Takeaways\n",
"\n",
"1. Prior predictive modeling helps us validate our model assumptions before using real data\n",
"2. The {class}`Prior <pymc_marketing.prior.prior.Prior>` class provides a convenient interface for:\n",
"2. The {class}`Prior <pymc_extras.prior.prior.Prior>` class provides a convenient interface for:\n",
" - Creating and visualizing prior distributions\n",
" - Sampling from prior predictive distributions\n",
"3. Always visualize your prior predictive distributions to ensure they align with your domain knowledge\n",
Expand Down
Loading
Loading