Probabilistic Machine Learning: An Introduction
by Kevin Patrick Murphy.
MIT Press, February 2022.
If you use this book, please be sure to cite
author = "Kevin P. Murphy",
title = "Probabilistic Machine Learning: An introduction",
publisher = "MIT Press",
year = 2022,
url = "probml.ai"
Table of contents
Code to recreate all the figures can be found in a series of colabs, one per chapter,
When reading the pdf version of the book, you can click on any link labeled figures.probml.ai/x.y and it will open up the colab for chapter x;
the cursor should scroll down to the cell for figure y.
Once you get there,
click on the button labeled 'setup' and it will install any necessary code.
(The first time you do this it may take about 10 seconds, but subsequent setups for other cells in the same chapter should be faster,
even if they open in a new tab.)
After setup, click on the following cell and it will run the code for you.
(It should automagically install any missing packages as well, although you may need to run the cell twice to make this work.)
The code for most figures is stored in individual files in the
You can run these locally (on your laptop), but it's often faster to run in colab (especially for demos that use a GPU).
To do this, just type `%run foo.py`. You can also edit the file in colab, and then rerun it.
Note, however, that changes to local files will not be saved beyond the current colab session.
(A better, but more complex, approach is to use VScode to ssh into the colab machine,
see this page
There are also some inline links to code in the body of the book, labeled code.probml.ai/foo; these refer to
demos that are not associated with any figure. Clicking on these links behaves in a similar way to the figure code (opening a tab for the appropriate
In addition to the above, each chapter has
supplementary code / material.
These will continue to be updated even after the book is published (contributions welcome!).
"The deep learning revolution has transformed the field of machine learning over the last decade.
It was inspired by attempts to mimic the way the brain learns but it is grounded in basic principles of statistics,
decision theory and optimization. This book does an excellent job of explaining these principles and describes many of the "classical"
machine learning methods that make use of them. It also shows how the same principles can be applied in deep learning systems
that contain many layers of features.
This provides a coherent framework in which one can understand the relationships and tradeoffs between many different ML approaches,
both old and new." -- Geoff Hinton. U. Toronto/ Google.
"Kevin Murphy’s book on machine learning is a superbly written,
comprehensive treatment of the field, built on a foundation of probability theory.
It is rigorous yet readily accessible, and
is a must-have for anyone interested in gaining a deep understanding of machine learning."
-- Chris Bishop,
"This book is a clear, concise, and rigorous introduction to the foundations of machine learning.
It beautifully bridges between the "traditional" topics and the more "modern" deep learning methods,
creating a unifying framework that contextualizes both of them. It's the book I recommend for people who are new to the
field and want to obtain a comprehensive view of the core principles and methods."
-- Daphne Koller, Insitro/ Stanford.
"This is a remarkable book covering the conceptual,
theoretical and computational foundations of probabilistic machine learning,
starting with the basics and moving seamlessly to the leading edge of this field.
The pedagogical structure of the book is extremely useful for teaching. One of my favorite parts is
that most of the figures of the book have a link to the associated
(python, JAX, tensorflow) code that is used to generate them,
often with comparisons between the different computational ways of solving the problems."
-- Michael Brenner, Harvard/ Google.
"This book could be titled 'What every ML PhD student should know'.
If you master the material in this book, you will have an outstanding foundation for successful research in machine learning.”
-- Tom Dietterich, Oregon State U.
"This book delivers a wonderful exposition of modern and traditional machine learning approaches through the language and lens of probabilistic reasoning.
As such, it provides extremely valuable and much needed coherence, generalisation, and mathematical rigour,
allowing the reader to gain a deep understanding of the interconnectivities between many different areas of data science,
and so deliver more effective outcomes.
I highly recommend this second edition"
-- Mark Briers, Alan Turing Institute.
- "There are many books on machine learning out there, but none gives
such a well-rounded, up-to-date, and comprehensive view of the
field as this one. We use this book as reference reading for our
students taking the advanced machine learning course at Oxford to
introduce them to fundamental as well as current topics in the
field. I'm amazed at the amount of work that went into this
book---which will surely be used by many to train the next
generation of machine learning experts."
-- Yarin Gal, U. Oxford
"This is a terrific resource for machine learning students and researchers.
If you want to understand the foundations of modern machine learning then this is the book to read.
The text is particularly strong at marrying classical ideas from statistics and probability with more modern concepts such as deep learning."
-- Padhraic Smyth, UC Irvine
- "My favorite machine learning book just received a face-lift!
'Probabilistic Machine Learning: An Introduction' is the most
comprehensive and accessible book on modern machine learning by a
It now also covers the latest developments in deep learning and
causal discovery. With this upgrade it will remain the reference
book for our field that every respected researcher needs to have
on their desk." -- Max Welling,
"Prof Murphy's 2012 book was a triumph, covering both basic material
and also the state-of-the-art. The new 'Probabilistic Machine
Learning: An Introduction' is similarly excellent, and includes new
material, especially on deep learning and recent developments. It
will become an essential reference for students and researchers in
probabilistic machine learning."
-- Chris Williams, U. Edinburgh
- "The book is really good."
-- Bernhard Scholkopf, U. Tuebingen
I would like to thank the following people for helping with this book.
- People who helped write some sections for vol 1:
Si Yi Meng,
- Proof readers: Peter Cerno, John Fearns.
- People who have provided feedback on parts of the book:
- People who have helped with the figures:
Sandeep Choudhary, and others who are credited in the figure captions.
- People who have helped with the code: Mahmoud Soliman,
Ming Liang Ang,
and other people listed