Skip to content

Commit 9c5430d

Browse files
committed
fix patsy and other typos
1 parent efc59bd commit 9c5430d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/generalized_linear_models/GLM-out-of-sample-predictions.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"source": [
3131
"# GLM in PyMC3: Out-Of-Sample Predictions\n",
3232
"\n",
33-
"In this notebook I explore the [glm](https://docs.pymc.io/api/glm.html) module of [PyMC3](https://docs.pymc.io/). I am particularly interested in the model definition using [pasty](https://patsy.readthedocs.io/en/latest/) formulas, as it makes the model evaluation loop faster (easier to include features and/or interactions). There are many good resources on this subject, but most of them evaluate the model in-sample. For many applications we require doing predictions on out-of-sample data. This experiment was motivated by the discussion of the thread [\"Out of sample\" predictions with the GLM sub-module](https://discourse.pymc.io/t/out-of-sample-predictions-with-the-glm-sub-module/773) on the (great!) forum [discourse.pymc.io/](https://discourse.pymc.io/), thank you all for your input!\n",
33+
"In this notebook I explore the [glm](https://docs.pymc.io/api/glm.html) module of [PyMC3](https://docs.pymc.io/). I am particularly interested in the model definition using [patsy](https://patsy.readthedocs.io/en/latest/) formulas, as it makes the model evaluation loop faster (easier to include features and/or interactions). There are many good resources on this subject, but most of them evaluate the model in-sample. For many applications we require doing predictions on out-of-sample data. This experiment was motivated by the discussion of the thread [\"Out of sample\" predictions with the GLM sub-module](https://discourse.pymc.io/t/out-of-sample-predictions-with-the-glm-sub-module/773) on the (great!) forum [discourse.pymc.io/](https://discourse.pymc.io/), thank you all for your input!\n",
3434
"\n",
3535
"**Resources**\n",
3636
"\n",
@@ -201,7 +201,7 @@
201201
"source": [
202202
"## Prepare Data for Modeling\n",
203203
"\n",
204-
"I wanted to use the *`classmethod`* `from_formula` (see [documentation](https://docs.pymc.io/api/glm.html)), but I was not able to generate out-of-sample predictions with this approach (if you find a way please let me know!). As a workaround, I created the features from a formula using [pasty](https://patsy.readthedocs.io/en/latest/) directly and then use *`class`* `pymc3.glm.linear.GLM` (this was motivated by going into the [source code](https://github.com/pymc-devs/pymc3/blob/master/pymc3/glm/linear.py))."
204+
"I wanted to use the *`classmethod`* `from_formula` (see [documentation](https://docs.pymc.io/api/glm.html)), but I was not able to generate out-of-sample predictions with this approach (if you find a way please let me know!). As a workaround, I created the features from a formula using [patsy](https://patsy.readthedocs.io/en/latest/) directly and then use *`class`* `pymc3.glm.linear.GLM` (this was motivated by going into the [source code](https://github.com/pymc-devs/pymc3/blob/master/pymc3/glm/linear.py))."
205205
],
206206
"cell_type": "markdown",
207207
"metadata": {}
@@ -390,7 +390,7 @@
390390
},
391391
{
392392
"source": [
393-
"So we can get summarize the model predictions (before seeing the data) but taking the mean over the samples. Let us store this in a dataframe to in order to generate some plots."
393+
"So we can get summarize the model predictions (before seeing the data) by taking the mean over the samples. Let us store this in a dataframe to in order to generate some plots."
394394
],
395395
"cell_type": "markdown",
396396
"metadata": {}
@@ -453,7 +453,7 @@
453453
},
454454
{
455455
"source": [
456-
"We clearly see that the model can not distinguish between the two classes yet. This makes sense as we have non-informative priors for this synthetic data set.We can also confirm this if we plot each point separately:"
456+
"We clearly see that the model can not distinguish between the two classes yet. This makes sense as we have non-informative priors for this synthetic data set. We can also confirm this if we plot each point separately:"
457457
],
458458
"cell_type": "markdown",
459459
"metadata": {}
@@ -861,4 +861,4 @@
861861
]
862862
}
863863
]
864-
}
864+
}

0 commit comments

Comments
 (0)