Skip to content

Commit

Permalink
Quick fix | Indexing MMM Allocation notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
cetagostini committed Oct 6, 2023
1 parent 09981a2 commit 5442418
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 81 deletions.
1 change: 1 addition & 0 deletions docs/source/notebooks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:maxdepth: 1

mmm/mmm_example
mmm/mmm_budget_allocation_example
:::

:::{toctree}
Expand Down
84 changes: 3 additions & 81 deletions docs/source/notebooks/mmm/mmm_budget_allocation_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"id": "J_ccrCpFyQ0A"
},
"source": [
"(mmm_budget_allocation_example)=\n",
"# **Budget Allocation with PyMC-Marketing**\n",
"\n",
"The purpose of this notebook is to explore the recently included function in the PyMC-Marketing library that focuses on budget allocation. This function's underpinnings are based on the methodologies inspired by Bolt work in his article, [\"Budgeting with Bayesian Models\"](https://bolt.eu/en/blog/budgeting-with-bayesian-models-pymc-marketing/).\n",
Expand Down Expand Up @@ -35,94 +36,15 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "-LnDMZnXIh-x",
"outputId": "8d14a8c8-d5c7-4894-8333-eb437b69cd17"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Cloning into 'pymc-marketing'...\n",
"remote: Enumerating objects: 2820, done.\u001b[K\n",
"remote: Counting objects: 100% (2820/2820), done.\u001b[K\n",
"remote: Compressing objects: 100% (1064/1064), done.\u001b[K\n",
"remote: Total 2820 (delta 1733), reused 2543 (delta 1595), pack-reused 0\u001b[K\n",
"Receiving objects: 100% (2820/2820), 161.71 MiB | 19.89 MiB/s, done.\n",
"Resolving deltas: 100% (1733/1733), done.\n",
"/content/pymc-marketing\n",
"Branch 'dev_budget_allocation_branch' set up to track remote branch 'dev_budget_allocation_branch' from 'origin'.\n",
"Switched to a new branch 'dev_budget_allocation_branch'\n",
"Obtaining file:///content/pymc-marketing\n",
" Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n",
" Checking if build backend supports build_editable ... \u001b[?25l\u001b[?25hdone\n",
" Getting requirements to build editable ... \u001b[?25l\u001b[?25hdone\n",
" Installing backend dependencies ... \u001b[?25l\u001b[?25hdone\n",
" Preparing editable metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
"Requirement already satisfied: arviz>=0.13.0 in /usr/local/lib/python3.10/dist-packages (from pymc-marketing==0.2.2) (0.15.1)\n",
"Requirement already satisfied: matplotlib>=3.5.1 in /usr/local/lib/python3.10/dist-packages (from pymc-marketing==0.2.2) (3.7.1)\n",
"Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from pymc-marketing==0.2.2) (1.23.5)\n",
"Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from pymc-marketing==0.2.2) (1.5.3)\n",
"Collecting pymc>=5.8.2 (from pymc-marketing==0.2.2)\n",
" Downloading pymc-5.8.2-py3-none-any.whl (468 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m468.9/468.9 kB\u001b[0m \u001b[31m7.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: scikit-learn>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from pymc-marketing==0.2.2) (1.2.2)\n",
"Requirement already satisfied: seaborn>=0.12.2 in /usr/local/lib/python3.10/dist-packages (from pymc-marketing==0.2.2) (0.12.2)\n",
"Requirement already satisfied: xarray in /usr/local/lib/python3.10/dist-packages (from pymc-marketing==0.2.2) (2023.7.0)\n",
"Requirement already satisfied: xarray-einstats>=0.5.1 in /usr/local/lib/python3.10/dist-packages (from pymc-marketing==0.2.2) (0.6.0)\n",
"Requirement already satisfied: setuptools>=60.0.0 in /usr/local/lib/python3.10/dist-packages (from arviz>=0.13.0->pymc-marketing==0.2.2) (67.7.2)\n",
"Requirement already satisfied: scipy>=1.8.0 in /usr/local/lib/python3.10/dist-packages (from arviz>=0.13.0->pymc-marketing==0.2.2) (1.11.2)\n",
"Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from arviz>=0.13.0->pymc-marketing==0.2.2) (23.1)\n",
"Requirement already satisfied: h5netcdf>=1.0.2 in /usr/local/lib/python3.10/dist-packages (from arviz>=0.13.0->pymc-marketing==0.2.2) (1.2.0)\n",
"Requirement already satisfied: typing-extensions>=4.1.0 in /usr/local/lib/python3.10/dist-packages (from arviz>=0.13.0->pymc-marketing==0.2.2) (4.5.0)\n",
"Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.5.1->pymc-marketing==0.2.2) (1.1.0)\n",
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.5.1->pymc-marketing==0.2.2) (0.11.0)\n",
"Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.5.1->pymc-marketing==0.2.2) (4.42.1)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.5.1->pymc-marketing==0.2.2) (1.4.5)\n",
"Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.5.1->pymc-marketing==0.2.2) (9.4.0)\n",
"Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.5.1->pymc-marketing==0.2.2) (3.1.1)\n",
"Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.5.1->pymc-marketing==0.2.2) (2.8.2)\n",
"Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->pymc-marketing==0.2.2) (2023.3.post1)\n",
"Requirement already satisfied: cachetools>=4.2.1 in /usr/local/lib/python3.10/dist-packages (from pymc>=5.8.2->pymc-marketing==0.2.2) (5.3.1)\n",
"Requirement already satisfied: cloudpickle in /usr/local/lib/python3.10/dist-packages (from pymc>=5.8.2->pymc-marketing==0.2.2) (2.2.1)\n",
"Requirement already satisfied: fastprogress>=0.2.0 in /usr/local/lib/python3.10/dist-packages (from pymc>=5.8.2->pymc-marketing==0.2.2) (1.0.3)\n",
"Collecting pytensor<2.17,>=2.16.1 (from pymc>=5.8.2->pymc-marketing==0.2.2)\n",
" Downloading pytensor-2.16.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.9/1.9 MB\u001b[0m \u001b[31m19.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: joblib>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=1.1.1->pymc-marketing==0.2.2) (1.3.2)\n",
"Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=1.1.1->pymc-marketing==0.2.2) (3.2.0)\n",
"Requirement already satisfied: h5py in /usr/local/lib/python3.10/dist-packages (from h5netcdf>=1.0.2->arviz>=0.13.0->pymc-marketing==0.2.2) (3.9.0)\n",
"Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from pytensor<2.17,>=2.16.1->pymc>=5.8.2->pymc-marketing==0.2.2) (3.12.2)\n",
"Requirement already satisfied: etuples in /usr/local/lib/python3.10/dist-packages (from pytensor<2.17,>=2.16.1->pymc>=5.8.2->pymc-marketing==0.2.2) (0.3.9)\n",
"Requirement already satisfied: logical-unification in /usr/local/lib/python3.10/dist-packages (from pytensor<2.17,>=2.16.1->pymc>=5.8.2->pymc-marketing==0.2.2) (0.4.6)\n",
"Requirement already satisfied: miniKanren in /usr/local/lib/python3.10/dist-packages (from pytensor<2.17,>=2.16.1->pymc>=5.8.2->pymc-marketing==0.2.2) (1.0.3)\n",
"Requirement already satisfied: cons in /usr/local/lib/python3.10/dist-packages (from pytensor<2.17,>=2.16.1->pymc>=5.8.2->pymc-marketing==0.2.2) (0.4.6)\n",
"Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.7->matplotlib>=3.5.1->pymc-marketing==0.2.2) (1.16.0)\n",
"Requirement already satisfied: toolz in /usr/local/lib/python3.10/dist-packages (from logical-unification->pytensor<2.17,>=2.16.1->pymc>=5.8.2->pymc-marketing==0.2.2) (0.12.0)\n",
"Requirement already satisfied: multipledispatch in /usr/local/lib/python3.10/dist-packages (from logical-unification->pytensor<2.17,>=2.16.1->pymc>=5.8.2->pymc-marketing==0.2.2) (1.0.0)\n",
"Building wheels for collected packages: pymc-marketing\n",
" Building editable for pymc-marketing (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
" Created wheel for pymc-marketing: filename=pymc_marketing-0.2.2-0.editable-py3-none-any.whl size=14286 sha256=d91459d525ee0b995dbcd0f1e629ad0c9c398cb4c7f5cbecc8e5b67c24783fce\n",
" Stored in directory: /tmp/pip-ephem-wheel-cache-6q5m8q43/wheels/4c/73/a2/763199784b23cfecb3523f816b288313aabbf991dea8428283\n",
"Successfully built pymc-marketing\n",
"Installing collected packages: pytensor, pymc, pymc-marketing\n",
" Attempting uninstall: pytensor\n",
" Found existing installation: pytensor 2.14.2\n",
" Uninstalling pytensor-2.14.2:\n",
" Successfully uninstalled pytensor-2.14.2\n",
" Attempting uninstall: pymc\n",
" Found existing installation: pymc 5.7.2\n",
" Uninstalling pymc-5.7.2:\n",
" Successfully uninstalled pymc-5.7.2\n",
"Successfully installed pymc-5.8.2 pymc-marketing-0.2.2 pytensor-2.16.3\n"
]
}
],
"outputs": [],
"source": [
"!pip install pymc-marketing"
]
Expand Down

0 comments on commit 5442418

Please sign in to comment.