# [Bayesian Methods for Hackers](http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/)
#### *Using Python and PyMC*
The Bayesian method is the natural approach to inference, yet it is hidden from readers behind chapters of slow, mathematical analysis. The typical text on Bayesian inference involves two to three chapters on probability theory, then enters what Bayesian inference is. Unfortunately, due to mathematical intractability of most Bayesian models, the reader is only shown simple, artificial examples. This can leave the user with a *so-what* feeling about Bayesian inference. In fact, this was the author's own prior opinion.
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.
If Bayesian inference is the destination, then mathematical analysis is a particular path towards it. On the other hand, computing power is cheap enough that we can afford to take an alternate route via probabilistic programming. The latter 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 latter 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.
*Bayesian Methods for Hackers* is designed as an 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 the 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.
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.
PyMC does have dependencies to run, namely NumPy and (optionally) SciPy. To not limit the user, the examples in this book will rely only on PyMC, NumPy, SciPy and Matplotlib.
Printed Version by Addison-Wesley
------
<div style="float: right; margin-left: 30px;"><img title="Bayesian Methods for Hackersg"style="float: right;margin-left: 30px;" src="http://www-fp.pearsonhighered.com/assets/hip/images/bigcovers/0133902838.jpg" align=right height = 200 /></div>
**Bayesian Methods for Hackers is now available as a printed book!** You can pick up a copy on [Amazon](http://www.amazon.com/Bayesian-Methods-Hackers-Probabilistic-Addison-Wesley/dp/0133902838). What are the differences between the online version and the printed version?
- Additional Chapter on Bayesian A/B testing
- Updated examples
- Answers to the end of chapter questions
- Additional explanation, and rewritten sections to aid the reader.
Contents
------
See the project homepage [here](http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/) for examples, too.
The below chapters are rendered via the *nbviewer* at
[nbviewer.jupyter.org/](http://nbviewer.jupyter.org/), and is read-only and rendered in real-time.
Interactive notebooks + examples can be downloaded by cloning!
### PyMC2
* [**Prologue:**](http://nbviewer.jupyter.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Prologue/Prologue.ipynb) Why we do it.
* [**Chapter 1: Introduction to Bayesian Methods**](http://nbviewer.jupyter.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Chapter1_Introduction/Ch1_Introduction_PyMC2.ipynb)
Introduction to the philosophy and practice of Bayesian methods and answering the question, "What is probabilistic programming?" Examples include:
- Inferring human behaviour changes from text message rates
* [**Chapter 2: A little more on PyMC**](http://nbviewer.jupyter.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Chapter2_MorePyMC/Ch2_MorePyMC_PyMC2.ipynb)
We explore modeling Bayesian problems using Python's PyMC library through examples. How do we create Bayesian models? Examples include:
- Detecting the frequency of cheating students, while avoiding liars
- Calculating probabilities of the Challenger space-shuttle disaster
* [**Chapter 3: Opening the Black Box of MCMC**](http://nbviewer.jupyter.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Chapter3_MCMC/Ch3_IntroMCMC_PyMC2.ipynb)
We discuss how MCMC operates and diagnostic tools. Examples include:
- Bayesian clustering with mixture models
* [**Chapter 4: The Greatest Theorem Never Told**](http://nbviewer.jupyter.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Chapter4_TheGreatestTheoremNeverTold/Ch4_LawOfLargeNumbers_PyMC2.ipynb)
We explore an incredibly useful, and dangerous, theorem: The Law of Large Numbers. Examples include:
- Exploring a Kaggle dataset and the pitfalls of naive analysis
- How to sort Reddit comments from best to worst (not as easy as you think)
* [**Chapter 5: Would you rather lose an arm or a leg?**](http://nbviewer.jupyter.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Chapter5_LossFunctions/Ch5_LossFunctions_PyMC2.ipynb)
The introduction of loss functions and their (awesome) use in Bayesian methods. Examples include:
- Solving the *Price is Right*'s Showdown
- Optimizing financial predictions
- Winning solution to the Kaggle Dark World's competition
* [**Chapter 6: Getting our *prior*-ities straight**](http://nbviewer.jupyter.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Chapter6_Priorities/Ch6_Priors_PyMC2.ipynb)
Probably the most important chapter. We draw on expert opinions to answer questions. Examples include:
- Multi-Armed Bandits and the Bayesian Bandit solution.
- What is the relationship between data sample size and prior?
- Estimating financial unknowns using expert priors
We explore useful tips to be objective in analysis as well as common pitfalls of priors.
### PyMC3
* [**Prologue:**](http://nbviewer.jupyter.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Prologue/Prologue.ipynb) Why we do it.
* [**Chapter 1: Introduction to Bayesian Methods**](http://nbviewer.jupyter.org/urls/raw.github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/master/Chapter1_Introduction/Ch1_Introduction_PyMC3.ipynb)
Introduction to the phil
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
【源码】《贝叶斯方法 概率编程与贝叶斯推断》随书源代码 (398个子文件)
config 364B
custom.css 2KB
census_data.csv 407KB
Training_Sky66.csv 32KB
Training_Sky106.csv 32KB
Training_Sky143.csv 32KB
Training_Sky89.csv 32KB
Training_Sky50.csv 32KB
Training_Sky237.csv 32KB
Training_Sky291.csv 32KB
Training_Sky189.csv 31KB
Training_Sky244.csv 31KB
Training_Sky204.csv 31KB
Training_Sky131.csv 31KB
Training_Sky248.csv 31KB
Training_Sky113.csv 31KB
Training_Sky11.csv 31KB
Training_Sky169.csv 31KB
Training_Sky154.csv 31KB
Training_Sky52.csv 31KB
Training_Sky42.csv 31KB
Training_Sky264.csv 31KB
Training_Sky300.csv 31KB
Training_Sky81.csv 31KB
Training_Sky92.csv 31KB
Training_Sky23.csv 31KB
Training_Sky22.csv 31KB
Training_Sky133.csv 31KB
Training_Sky224.csv 31KB
Training_Sky263.csv 31KB
Training_Sky95.csv 31KB
Training_Sky28.csv 30KB
Training_Sky266.csv 30KB
Training_Sky295.csv 30KB
Training_Sky202.csv 30KB
Training_Sky205.csv 30KB
Training_Sky18.csv 30KB
Training_Sky170.csv 30KB
Training_Sky286.csv 30KB
Training_Sky17.csv 30KB
Training_Sky182.csv 30KB
Training_Sky227.csv 30KB
Training_Sky165.csv 30KB
Training_Sky49.csv 30KB
Training_Sky194.csv 30KB
Training_Sky36.csv 29KB
Training_Sky34.csv 29KB
Training_Sky299.csv 29KB
Training_Sky13.csv 29KB
Training_Sky97.csv 29KB
Training_Sky121.csv 29KB
Training_Sky151.csv 29KB
Training_Sky93.csv 29KB
Training_Sky123.csv 29KB
Training_Sky181.csv 29KB
Training_Sky190.csv 29KB
Training_Sky252.csv 29KB
Training_Sky78.csv 29KB
Training_Sky282.csv 29KB
Training_Sky141.csv 29KB
Training_Sky29.csv 28KB
Training_Sky230.csv 28KB
Training_Sky108.csv 28KB
Training_Sky298.csv 28KB
Training_Sky219.csv 28KB
Training_Sky157.csv 28KB
Training_Sky20.csv 28KB
Training_Sky26.csv 28KB
Training_Sky180.csv 28KB
Training_Sky44.csv 28KB
Training_Sky220.csv 28KB
Training_Sky274.csv 28KB
Training_Sky284.csv 28KB
Training_Sky183.csv 28KB
Training_Sky280.csv 28KB
Training_Sky90.csv 28KB
Training_Sky91.csv 28KB
Training_Sky41.csv 28KB
Training_Sky293.csv 28KB
Training_Sky279.csv 27KB
Training_Sky102.csv 27KB
Training_Sky88.csv 27KB
Training_Sky192.csv 27KB
Training_Sky72.csv 27KB
Training_Sky111.csv 27KB
Training_Sky125.csv 27KB
Training_Sky58.csv 27KB
Training_Sky115.csv 27KB
Training_Sky27.csv 27KB
Training_Sky233.csv 27KB
Training_Sky19.csv 27KB
Training_Sky116.csv 27KB
Training_Sky83.csv 27KB
Training_Sky146.csv 27KB
Training_Sky171.csv 27KB
Training_Sky240.csv 27KB
Training_Sky186.csv 27KB
Training_Sky114.csv 27KB
Training_Sky269.csv 27KB
Training_Sky67.csv 27KB
共 398 条
- 1
- 2
- 3
- 4
资源评论
- loadbalancing2019-04-07正在学习这本书。非常感谢共享本书源代码。
kingdom10s
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功