186 points · by luu · 13y ago · 23 comments
This seems inspired by the awesome Yudkowsky article that comes from a similar (introductory, not programming-specific) place: http://yudkowsky.net/rational/bayes/
For anyone that hasn't used IPython notebook and is interested in scientific computing in python, you need to check it out. The ability to mix prose and live python, with effortless plotting, storable in git, sharable with links or nbviewer, is just magic. That probably seems mundane, but for things like exploratory data analysis across a team, it's a game-changer. Another staple in this stack is Pandas ( http://pandas.pydata.org/ )
Dynamic[Graphics[Disk[p]]]
And then somewhere else, either manually or programmatically, you change the value of p, you will see the disk move around. (In link [1], open up the "Neat Examples" dropdown).Basically, with Dynamic you are saying "I want this updated as soon as any of its components are updated." And the system takes care of the rest. Furthermore, the dynamic content can be completely arbitrary. Mathematica's Manipulate symbol[2] is essentially a wrapper around Dynamic. See [3] for countless examples built using Manipulate.
To be clear, these aren't "generated programs." All this dynamism resides comfortably and natively inside notebooks. (Mathematica also allows data that persists across sessions, through DynamicModule).
See the last example in [4], combine that with the fact that you can have arbitrary expressions anywhere, and you can start to get a sense of the power the system gives you. For example, you can create an ad-hoc tool for making diagrams or whatever, and then plop that tool right in the middle of a piece of source code, inline.
As another example of the power of Mathematica's notebooks, links [1] [2] and [4] are HTML exports of Mathematica notebooks. Note all of the fancy formatting.
But wait, there's more, as Mathematica notebooks are themselves fundamentally Mathematica expressions (essentially M-expressions. Mathematica is in part a Lisp on top of symbolic semantics). Thus you can construct/alter them programmatically, etc. In other words, Mathematica is a ridiculously homoiconic system, not only in the language sense but also in the broader systemic sense. As an example, [5] is the Mathematica expression behind the notebook of [4].
[1] http://reference.wolfram.com/mathematica/ref/Dynamic.html
[2] http://reference.wolfram.com/mathematica/ref/Manipulate.html
[3] http://demonstrations.wolfram.com/
[4] http://reference.wolfram.com/mathematica/ref/DynamicSetting....
The Elements of Statistical Learning by Hastie, Tibshirani and Friedman, available for free on line.
Pattern Recognition and Machine Learning by Chris Bishop. Very Bayesian.
Machine Learning: A Probabilistic Perspective by Kevin Murphy. Also Bayesian, although not as Bayesian as Bishop. The most recent of the three, and therefore covers a few topics not covered elsewhere like deep learning and conditional random fields. The first few printings are full of errors and confusing passages, should be better before too long.
Did I miss any?
It differs from other books in that all the material is treated from the unified perspective of statistical learning theory and VC dimension, as a result the book feels less like a hodgepodge of unrelated techniques and more like an introduction to a coherent field.
Hastie and Tibshirani also have a new, less demanding mathematically book out:
http://www.amazon.com/Introduction-Statistical-Learning-Appl...
1. David Barber: Bayesian Reasoning and Machine Learning
2. David MacKay: Information Theory, Inference, and Learning Algorithms
[1] http://www.cs.ucl.ac.uk/staff/d.barber/brml/
[2] http://www.inference.phy.cam.ac.uk/mackay/itila/
Both require a willingness to immerse in the mathematics. But the maths isn't hard, even for someone like me who hasn't formally studied it since I was 15.
http://metaoptimize.com/qa/questions/186/good-freely-availab...
Esp:
http://web4.cs.ucl.ac.uk/staff/D.Barber/pmwiki/pmwiki.php?n=...
http://www.inference.phy.cam.ac.uk/itprnn/book.html
http://alex.smola.org/drafts/thebook.pdf
___________
and MLPP errata: http://www.cs.ubc.ca/~murphyk/MLbook/errata.html
One huge reason why is that the author has implemented everything you use in Python in a way that enables you to read his code to more fully understand what's happening. I'm on chapter 5 or 6 and he hasn't even touched on MCMC yet which is most welcome.
PyMC is a toolkit that makes it easier to write inference code for a wide range of models, but isn't as automatic as the field of probabilistic programming promises.
As it says on the linked site, it lists more than probabilistic programming systems, and PyMC falls into the latter categories of things it lists:
Below we have compiled a list of probabilistic programming systems including languages, implementations/compilers, as well as software libraries for constructing probabilistic models and toolkits for building probabilistic inference algorithms.
Despite not introducing a new language syntax or DSL, PyMC is still probabilistic programming in the sense that you have python variables that represent random variables with prior distributions and then use those to derive new random variables by using deterministic python expressions or functions. Finally you plug an inference engine to be able to invert the execution order and derive a posterior distribution on the unobserved variables.
I've been toying with ideas relating to some kind of text-book killing general publishing platform for a while, but it's not something I'll implement (in the next 5 years anyway). Obviously people are doing this kind of thing already, but this is certainly the closest implementation to the ideas I've been thinking about that I've seen.