Skip to content

Commit bc7ab3c

Browse files
committed
swapped out class pm.Data to just pm.Data
1 parent 2df0716 commit bc7ab3c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

examples/fundamentals/data_container.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@
715715
"cell_type": "markdown",
716716
"metadata": {},
717717
"source": [
718-
"In this next model, we create a {class}`pm.Data` container to hold the observations, and pass this container to the `observed`. We also make a {class}`pm.Data` container to hold the `x` data:"
718+
"In this next model, we create a `pm.Data` container to hold the observations, and pass this container to the `observed`. We also make a `pm.Data` container to hold the `x` data:"
719719
]
720720
},
721721
{
@@ -793,7 +793,7 @@
793793
"cell_type": "markdown",
794794
"metadata": {},
795795
"source": [
796-
"Because we used a {class}`pm.Data` container, the data now appears in our probabilistic graph. It is downstream from `obs` (since the `obs` variable \"causes\" the data), shaded in gray (because it is observed), and has a special rounded square shape to emphasize that it is data. We also see that `x_data` has been added to the graph."
796+
"Because we used a `pm.Data` container, the data now appears in our probabilistic graph. It is downstream from `obs` (since the `obs` variable \"causes\" the data), shaded in gray (because it is observed), and has a special rounded square shape to emphasize that it is data. We also see that `x_data` has been added to the graph."
797797
]
798798
},
799799
{
@@ -1509,7 +1509,7 @@
15091509
"cell_type": "markdown",
15101510
"metadata": {},
15111511
"source": [
1512-
"As noted above, {class}`pm.Data` gives you the ability to give named labels to the dimensions of your data. This is done by passing a dictionary of `dimension: coordinate` key-value pairs to the `coords` argument of {class}`pymc.Model` when you create your model.\n",
1512+
"As noted above, `pm.Data` gives you the ability to give named labels to the dimensions of your data. This is done by passing a dictionary of `dimension: coordinate` key-value pairs to the `coords` argument of {class}`pymc.Model` when you create your model.\n",
15131513
"\n",
15141514
"For more explanation about dimensions, coordinates and their big benefits, we encourage you to take a look at the {ref}`ArviZ documentation <arviz:xarray_for_arviz>`.\n",
15151515
"\n",
@@ -1826,7 +1826,7 @@
18261826
"cell_type": "markdown",
18271827
"metadata": {},
18281828
"source": [
1829-
"When we use {class}`pm.Data`, the data are internally represented as a pytensor {class}`pytensor.tensor.sharedvar.TensorSharedVariable`."
1829+
"When we use `pm.Data`, the data are internally represented as a pytensor {class}`pytensor.tensor.sharedvar.TensorSharedVariable`."
18301830
]
18311831
},
18321832
{
@@ -2527,7 +2527,7 @@
25272527
"\n",
25282528
"One small detail to pay attention to in this case is that the shapes of the input data (`x`) and output data (`obs`) must be the same. When we make out-of-sample predictions, we typically change only the input data, the shape of which may not be the same as the training observations. Naively changing only one will result in a shape error. There are two solutions:\n",
25292529
"\n",
2530-
"1. Use a {class}`pm.Data` for the `x` data and the `y` data, and use `pm.set_data` to change `y` to something of the same shape as the test inputs. \n",
2530+
"1. Use a `pm.Data` for the `x` data and the `y` data, and use `pm.set_data` to change `y` to something of the same shape as the test inputs. \n",
25312531
"2. Tell PyMC that the shape of the `obs` should always be the shape of the input data.\n",
25322532
"\n",
25332533
"In the next model, we use option 2. This way, we don't need to pass dummy data to `y` every time we want to change `x`."

examples/fundamentals/data_container.myst.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Furthermore, inside `idata`, PyMC has automatically saved the observed (endogeno
9595
idata.observed_data
9696
```
9797

98-
In this next model, we create a {class}`pm.Data` container to hold the observations, and pass this container to the `observed`. We also make a {class}`pm.Data` container to hold the `x` data:
98+
In this next model, we create a `pm.Data` container to hold the observations, and pass this container to the `observed`. We also make a `pm.Data` container to hold the `x` data:
9999

100100
```{code-cell} ipython3
101101
with pm.Model() as no_data_model:
@@ -108,7 +108,7 @@ with pm.Model() as no_data_model:
108108
idata = pm.sample(random_seed=RANDOM_SEED)
109109
```
110110

111-
Because we used a {class}`pm.Data` container, the data now appears in our probabilistic graph. It is downstream from `obs` (since the `obs` variable "causes" the data), shaded in gray (because it is observed), and has a special rounded square shape to emphasize that it is data. We also see that `x_data` has been added to the graph.
111+
Because we used a `pm.Data` container, the data now appears in our probabilistic graph. It is downstream from `obs` (since the `obs` variable "causes" the data), shaded in gray (because it is observed), and has a special rounded square shape to emphasize that it is data. We also see that `x_data` has been added to the graph.
112112

113113
```{code-cell} ipython3
114114
pm.model_to_graphviz(no_data_model)
@@ -138,7 +138,7 @@ df_data.index.name = "date"
138138
df_data.head()
139139
```
140140

141-
As noted above, {class}`pm.Data` gives you the ability to give named labels to the dimensions of your data. This is done by passing a dictionary of `dimension: coordinate` key-value pairs to the `coords` argument of {class}`pymc.Model` when you create your model.
141+
As noted above, `pm.Data` gives you the ability to give named labels to the dimensions of your data. This is done by passing a dictionary of `dimension: coordinate` key-value pairs to the `coords` argument of {class}`pymc.Model` when you create your model.
142142

143143
For more explanation about dimensions, coordinates and their big benefits, we encourage you to take a look at the {ref}`ArviZ documentation <arviz:xarray_for_arviz>`.
144144

@@ -193,7 +193,7 @@ Coordinates are also used by `arviz` when making plots. Here we pass `legend=Tru
193193
axes = az.plot_trace(idata, var_names=["europe_mean_temp", "expected_city_temp"], legend=True);
194194
```
195195

196-
When we use {class}`pm.Data`, the data are internally represented as a pytensor {class}`pytensor.tensor.sharedvar.TensorSharedVariable`.
196+
When we use `pm.Data`, the data are internally represented as a pytensor {class}`pytensor.tensor.sharedvar.TensorSharedVariable`.
197197

198198
```{code-cell} ipython3
199199
type(data)
@@ -277,7 +277,7 @@ A common task in machine learning is to predict values for unseen data, and the
277277

278278
One small detail to pay attention to in this case is that the shapes of the input data (`x`) and output data (`obs`) must be the same. When we make out-of-sample predictions, we typically change only the input data, the shape of which may not be the same as the training observations. Naively changing only one will result in a shape error. There are two solutions:
279279

280-
1. Use a {class}`pm.Data` for the `x` data and the `y` data, and use `pm.set_data` to change `y` to something of the same shape as the test inputs.
280+
1. Use a `pm.Data` for the `x` data and the `y` data, and use `pm.set_data` to change `y` to something of the same shape as the test inputs.
281281
2. Tell PyMC that the shape of the `obs` should always be the shape of the input data.
282282

283283
In the next model, we use option 2. This way, we don't need to pass dummy data to `y` every time we want to change `x`.

0 commit comments

Comments
 (0)