Skip to content

Commit 64cacac

Browse files
Merge branch 'master' of github.com:CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
2 parents 2466b4b + fb92d57 commit 64cacac

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

Chapter1_Introduction/Chapter1_Introduction.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
"source": [
234234
"The posterior probabilities are represented by the curves, and our confidence is proportional to the height of the curve. As the plot above shows, as we start to observe data our posterior probabilities start to shift and move around. Eventually, as we observe more and more data (coin-flips), our probabilities will lump closer and closer around the true value of $p=0.5$ (marked by a dashed line). \n",
235235
"\n",
236-
"Notice that the plots are not always *peaked* at 0.5. There is no reason it should be: recall we assumed we did not have a prior opinion of what $p$ is. In fact, if we observe quite extreme data, say 8 flips and only 1 observed heads, our distribution would look very biased *away* from lumping around 0.5. As more data accumulates, we would see more and more probabilitiy being assigned at $p=0.5$.\n",
236+
"Notice that the plots are not always *peaked* at 0.5. There is no reason it should be: recall we assumed we did not have a prior opinion of what $p$ is. In fact, if we observe quite extreme data, say 8 flips and only 1 observed heads, our distribution would look very biased *away* from lumping around 0.5. As more data accumulates, we would see more and more probability being assigned at $p=0.5$.\n",
237237
"\n",
238238
"The next example is a simple demonstration of the mathematics of Bayesian inference. "
239239
]
@@ -690,12 +690,11 @@
690690
"cell_type": "code",
691691
"collapsed": false,
692692
"input": [
693-
"### Myserious code to be explained in Chapter 3.\n",
693+
"### Mysterious code to be explained in Chapter 3.\n",
694694
"mcmc = mc.MCMC(model)\n",
695695
"mcmc.sample( 35000, 5000, 1 )"
696696
],
697697
"language": "python",
698-
"metadata": {},
699698
"outputs": [
700699
{
701700
"output_type": "stream",

LICENSE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2013 Cameron Davidson-Pilon, LLC
1+
Copyright (c) 2013 Cameron Davidson-Pilon
22

33
Permission is hereby granted, free of charge, to any person
44
obtaining a copy of this software and associated documentation
@@ -19,4 +19,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
1919
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
2020
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2121
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22-
OTHER DEALINGS IN THE SOFTWARE.
22+
OTHER DEALINGS IN THE SOFTWARE.

Prologue/Prologue.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
"<div style=\"float: right; margin-left:30px\"><img title=\"created by Stef Gibson at StefGibson.com\"style=\"float: right;\" src=\"http://i.imgur.com/6DKYbPb.png?1\" align=right height = 390 /></div>\n",
2929
"\n",
3030
"\n",
31-
"After some recent success of Bayesian methods in machine-learning competitions, I decided to investigate the subject again. Even with my mathematical background, it took me three straight-days of reading examples and trying to put the pieces together to understand the methods. There was simplely not enough literature bridging theory to practice. The problem with my misunderstanding was the disconnect between Bayesian mathematics and probabilistic programming. That being said, I suffered then so the reader would not have to now. This book attempts to bridge the gap.\n",
31+
"After some recent success of Bayesian methods in machine-learning competitions, I decided to investigate the subject again. Even with my mathematical background, it took me three straight-days of reading examples and trying to put the pieces together to understand the methods. There was simply not enough literature bridging theory to practice. The problem with my misunderstanding was the disconnect between Bayesian mathematics and probabilistic programming. That being said, I suffered then so the reader would not have to now. This book attempts to bridge the gap.\n",
3232
"\n",
3333
"If Bayesian inference is the destination, then mathematical analysis is a particular path to it. On the other hand, computing power is cheap enough that we can afford to take an alternate route via probabilistic programming. The path is much more useful, as it denies the necessity of mathematical intervention at each step, that is, we remove often-intractable mathematical analysis as a prerequisite to Bayesian inference. Simply put, this computational path proceeds via small intermediate jumps from beginning to end, where as the first path proceeds by enormous leaps, often landing far away from our target. Furthermore, without a strong mathematical background, the analysis required by the first path cannot even take place.\n",
3434
"\n",
35-
"*Bayesian Methods for Hackers* is designed as a introduction to Bayesian inference from a computational/understanding-first, and mathematics-second, point of view. Of course as an introductory book, we can only leave it at that: an introductory book. For the mathematically trained, they may cure their curiousity this text generates with other texts designed with mathematical analysis in mind. For the enthusiast with less mathematical-background, or one who is not interested in the mathematics but simply the practice of Bayesian methods, this text should be sufficient and entertaining.\n",
35+
"*Bayesian Methods for Hackers* is designed as a introduction to Bayesian inference from a computational/understanding-first, and mathematics-second, point of view. Of course as an introductory book, we can only leave it at that: an introductory book. For the mathematically trained, they may cure their curiosity this text generates with other texts designed with mathematical analysis in mind. For the enthusiast with less mathematical-background, or one who is not interested in the mathematics but simply the practice of Bayesian methods, this text should be sufficient and entertaining.\n",
3636
"\n",
3737
"\n",
3838
"The choice of PyMC as the probabilistic programming language is two-fold. As of this writing, there is currently no central resource for examples and explanations in the PyMC universe. The official documentation assumes prior knowledge of Bayesian inference and probabilistic programming. We hope this book encourages users at every level to look at PyMC. Secondly, with recent core developments and popularity of the scientific stack in Python, PyMC is likely to become a core component soon enough.\n",
@@ -85,7 +85,7 @@
8585
"* **Chapter X1: Bayesian Markov Models**\n",
8686
" \n",
8787
"* **Chapter X2: Bayesian methods in Machine Learning** \n",
88-
" We explore how to resolve the overfitting problem plus popular ML methods. Also included are probablistic explainations of Ridge Regression and LASSO Regression.\n",
88+
" We explore how to resolve the overfitting problem plus popular ML methods. Also included are probabilistic explanations of Ridge Regression and LASSO Regression.\n",
8989
" - Bayesian spam filtering plus *how to defeat Bayesian spam filtering*\n",
9090
" - Tim Saliman's winning solution to Kaggle's *Don't Overfit* problem \n",
9191
" \n",
@@ -97,7 +97,7 @@
9797
"\n",
9898
" \n",
9999
"**More questions about PyMC?**\n",
100-
"Please post your modeling, convergence, or any other PyMC question on [cross-validated](http://stats.stackexchange.com/), the statistcs stack-exchange.\n",
100+
"Please post your modeling, convergence, or any other PyMC question on [cross-validated](http://stats.stackexchange.com/), the statistics stack-exchange.\n",
101101
" \n",
102102
" \n",
103103
"Using the book\n",
@@ -116,7 +116,7 @@
116116
"The contents are updated synchronously as commits are made to the book. You can use the Contents section above to link to the chapters.\n",
117117
" \n",
118118
"3. The most traditional approach, but also not recommended, is to read the chapters as PDFs contained in the `previews` folder. The content\n",
119-
"in these PDFs is not guarunteed to be the most recent content as the PDFs are only compiled periodically. Similarly, the book will not be\n",
119+
"in these PDFs is not guaranteed to be the most recent content as the PDFs are only compiled periodically. Similarly, the book will not be\n",
120120
"interactive.\n",
121121
" \n",
122122
"\n",
@@ -148,7 +148,7 @@
148148
"- The current chapter list is not finalized. If you see something that is missing (MCMC, MAP, Bayesian networks, good prior choices, Potential classes etc.),\n",
149149
"feel free to start there. \n",
150150
"- Cleaning up Python code and making code more PyMC-esque.\n",
151-
"- Giving better explainations\n",
151+
"- Giving better explanations\n",
152152
"- Contributing to the IPython notebook styles.\n",
153153
"\n",
154154
"\n",

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Contents
3030
Interactive notebooks + examples can be downloaded by cloning! )
3131

3232

33-
* [**Prologue.**](http://nbviewer.ipython.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Prologue/Prologue.ipynb) Why we do it.
33+
* [**Prologue:**](http://nbviewer.ipython.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Prologue/Prologue.ipynb) Why we do it.
3434

3535
* [**Chapter 1: Introduction to Bayesian Methods**](http://nbviewer.ipython.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Chapter1_Introduction/Chapter1_Introduction.ipynb)
3636
Introduction to the philosophy and practice of Bayesian methods and answering the question "What is probabilistic programming?" Examples include:
@@ -51,7 +51,7 @@ Interactive notebooks + examples can be downloaded by cloning! )
5151
- How to sort Reddit comments from best to worst (not as easy as you think)
5252

5353
* [**Chapter 5: Would you rather loss an arm or a leg?**](http://nbviewer.ipython.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Chapter5_LossFunctions/LossFunctions.ipynb)
54-
The introduction of Loss functions and there (awesome) use in Bayesian methods. Examples include:
54+
The introduction of Loss functions and their (awesome) use in Bayesian methods. Examples include:
5555
- Solving the Price is Right's Showdown
5656
- Optimizing financial predictions
5757
- Winning solution to the Kaggle Dark World's competition.
@@ -107,6 +107,8 @@ Installation and configuration
107107
If you would like to run the IPython notebooks locally, (option 1. above), you'll need to install the following:
108108
- IPython 0.13 is a requirement to view the ipynb files. It can be downloaded [here](http://ipython.org/ipython-doc/dev/install/index.html)
109109
- For Linux users, you should not have a problem installing Numpy, Scipy and PyMC. For Windows users, check out [pre-compiled versions](http://www.lfd.uci.edu/~gohlke/pythonlibs/) if you have difficulty.
110+
- also recommended, for data-mining exercises, are [PRAW](https://github.com/praw-dev/praw) and [requests](https://github.com/kennethreitz/requests).
111+
110112
- In the styles/ directory are a number of files that are customized for the notebook.
111113
These are not only designed for the book, but they offer many improvements over the
112114
default settings of matplotlib and the IPython notebook. The in notebook style has not been finalized yet.

0 commit comments

Comments
 (0)