Skip to content

Coregion model notebook fix #786

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

Merged
merged 5 commits into from
Apr 16, 2025
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: pre-commit/action@v2.0.0
- uses: pre-commit/action@v3.0.0
507 changes: 218 additions & 289 deletions examples/gaussian_processes/MOGP-Coregion-Hadamard.ipynb

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions examples/gaussian_processes/MOGP-Coregion-Hadamard.myst.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jupytext:
format_name: myst
format_version: 0.13
kernelspec:
display_name: Python 3 (ipykernel)
display_name: default
language: python
name: python3
---
Expand All @@ -26,6 +26,8 @@ This notebook shows how to implement the **Intrinsic Coregionalization Model** (
The advantage of Multi-output Gaussian Processes is their capacity to simultaneously learn and infer many outputs which have the same source of uncertainty from inputs. In this example, we model the average spin rates of several pitchers in different games from a baseball dataset.

```{code-cell} ipython3
import warnings

import arviz as az
import matplotlib.pyplot as plt
import numpy as np
Expand All @@ -34,6 +36,8 @@ import pymc as pm
import pytensor.tensor as pt

from pymc.gp.util import plot_gp_dist

warnings.filterwarnings("ignore", category=FutureWarning, module="pytensor.tensor.blas")
```

```{code-cell} ipython3
Expand Down Expand Up @@ -93,7 +97,7 @@ adf["avg_spin_rate"].describe()

```{code-cell} ipython3
# There are 142 game dates from 01 Apr 2021 to 03 Oct 2021.
adf.loc[:, "game_date"] = pd.to_datetime(adf.loc[:, "game_date"])
adf["game_date"] = pd.to_datetime(adf["game_date"])
game_dates = adf.loc[:, "game_date"]
game_dates.min(), game_dates.max(), game_dates.nunique(), (game_dates.max() - game_dates.min())
```
Expand Down
1 change: 1 addition & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ numba = ">=0.60.0,<0.61"
scikit-learn = ">=1.5.2,<2"
blackjax = ">=1.2.3,<2"
networkx = ">=3.4.2,<4"
bokeh = ">=3.7.2,<4"

[pypi-dependencies]
pymc-experimental = ">=0.1.2, <0.2"
Expand Down