pymc-examples
pymc-examples copied to clipboard
Update example notebooks for better rendering
NOTE
This issue is reserved for the #DataUmbrellaPyMCSprint
References
List of PyMC Example Notebooks that Need to be Updated
examples/case_studies
- [x] examples/case_studies/hierarchical_partial_pooling.ipynb (@azihna) (v5 run by RS) https://github.com/pymc-devs/pymc-examples/pull/393
- [x] examples/case_studies/spline.ipynb (@kuvychko) https://github.com/pymc-devs/pymc-examples/pull/403
KeyError: "Dimensions {'obs'} are unknown to the model and cannot be used to specify a `shape`."
- [ ] examples/case_studies/stochastic_volatility.ipynb Error with graphviz import, need to add
## Watermarkcell
examples/diagnostics_and_criticism
- [x] examples/diagnostics_and_criticism/Bayes_factor.ipynb (@reshamas) (v5 done) https://github.com/pymc-devs/pymc-examples/pull/395
- [x] examples/diagnostics_and_criticism/Diagnosing_biased_Inference_with_Divergences.ipynb (@reshamas) (ISSUE #66) https://github.com/pymc-devs/pymc-examples/pull/402
- [x] examples/diagnostics_and_criticism/model_averaging.ipynb (@reshamas) (ISSUE #67) https://github.com/pymc-devs/pymc-examples/pull/414
- [x] examples/diagnostics_and_criticism/sampler-stats.ipynb (@reshamas) (ISSUE: None open) https://github.com/pymc-devs/pymc-examples/pull/426
examples/generalized_linear_models
- [x] examples/generalized_linear_models/GLM-hierarchical.ipynb (@reshamas) (v5 done) https://github.com/pymc-devs/pymc-examples/pull/427
- [x] examples/generalized_linear_models/GLM-robust.ipynb (@kuvychko)
- [x] examples/generalized_linear_models/GLM-robust-regression.ipynb (@reshamas) (v5 done)
- [x] examples/generalized_linear_models/GLM-rolling-regression.ipynb (@reshamas) (v5) https://github.com/pymc-devs/pymc-examples/pull/434
- [x] examples/generalized_linear_models/GLM-simpsons-paradox.ipynb (no updates needed to header/footer)
ImportError: This function requires the python library graphviz, along with binaries. The easiest way to install all of this is by running
conda install -c conda-forge python-graphviz
- [x] examples/generalized_linear_models/GLM-poisson-regression.ipynb (@reshamas) https://github.com/pymc-devs/pymc-examples/pull/462
TypeError: You are calling an Aesara function with PyTensor variables.
Starting with PyMC 5.0, Aesara was replaced by PyTensor (see https://www.pymc.io/blog/pytensor_announcement.html).
Replace your import of aesara.tensor with pytensor.tensor.
- [ ] examples/generalized_linear_models/GLM-out-of-sample-predictions.ipynb https://github.com/pymc-devs/pymc-examples/pull/471
examples/howto
- [x] examples/howto/updating_priors.ipynb (@symeneses) https://github.com/pymc-devs/pymc/issues/5959
examples/survival_analysis
- [ ] examples/survival_analysis/weibull_aft.ipynb (@reshamas) https://github.com/pymc-devs/pymc/issues/ ?
Set-up Instructions
- Fork and clone this repository; set upstream remote, etc.
- A virtual environment should be set up and the packages in requirements.txt should be installed.
- Use a feature branch
git checkout -b nb_feature_branch - Reminder: sync the repo
Notes for Updating Notebook
- Update First Cell.
- For
tags, see options in current notebook tags - Update Last Cell.
- Optional: Go through Jupyter style guide and make other updates.
- For authorship of notebooks, we can search in the "pymc" repo pymc closed pull requests.
- Check that all links work in the notebook
- Replace mentions of "PyMC3" to "PyMC"
- Watermark: Add a Markdown cell for ## Watermark
- References can be found in examples/references.bib
- REMINDER: Rerun full notebook before submitting a PR or creating the myst file.
- Run
pre-commit(pre-commit run --all) - Example of description text for PR: https://github.com/pymc-devs/pymc-examples/pull/402
References
Note: pymc-examples#8
* Moved from pymc to pymc-examples repo in December 2020 ([pymc-examples#8](https://github.com/pymc-devs/pymc-examples/pull/8))
- references.bib
- If extra dependencies have to be added: https://docs.pymc.io/en/latest/contributing/jupyter_style.html#extra-dependencies
Examples of references
Example 1: [ArviZ's naming convention](https://arviz-devs.github.io/arviz/schema/schema.html#sample-stats)
{ref}`ArviZ's naming convention <arviz:schema>`
Example 2: [check this page](https://docs.pymc.io/api/inference.html#module-pymc3.step_methods.hmc.nuts)
{class}`pymc.NUTS`
FAQs
Syncing Repo (via @symeneses)
# update you main branch
git checkout main
git fetch upstream
git rebase upstream/main
# update your branch
git checkout feature
git rebase origin/main
Running pre-commit
- Stage the notebook (
git commit -m 'message') - Run pre-commit, this will create the .myst file (
pre-commit run --all) git status==> you will now see a.mystfile created- Stage the .myst file (
git commit -am 'adding myst file') - Run pre-commit and tests should now pass (
pre-commit run --all) - Push changes:
git push origin branch_name
There already is a "I will work on this" comment on the issue
If the issue is more than 3 months old, you can ignore that message and comment yourself you plan to work on that issue.
I am working on: examples/diagnostics_and_criticism/Bayes_factor.ipynb
Updated the title as the task is about updating the markdown content and metadata, without rerunning the notebook.
The issue to update the notebooks from v3 to v4 is https://github.com/pymc-devs/pymc-examples/issues/333. The two tasks are independent and can be done sequentially or together... hoping to avoid confusion about the scope of the issue.
I am working on: examples/diagnostics_and_criticism/Diagnosing_biased_Inference_with_Divergences.ipynb
I am working on the notebook updating_priors. Waiting for the issue https://github.com/pymc-devs/pymc/issues/5959 to be solved.
I am working on: examples/diagnostics_and_criticism/Diagnosing_biased_Inference_with_Divergences.ipynb
@jlindbloom I didn't notice you were working on this. Sorry! I submitted a PR on this one, #402