Probabilistic Machine Learning: An Introduction
by Kevin Patrick Murphy.
MIT Press, March 2022.
Key links
If you use this book, please be sure to cite
@book{pml1Book,
author = "Kevin P. Murphy",
title = "Probabilistic Machine Learning: An introduction",
publisher = "MIT Press",
year = 2022,
url = "probml.ai"
}
Downloads since 20210101.
Code to recreate all the figures can be found in a series of colabs, one per chapter,
stored
here.
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
scripts directory.
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
for details.)
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
colab cell).
In addition to the above, many chapters have supplementary code / material (for example,
here).
These will continue to be updated even after the book is published (contributions welcome!).
Reviews

Review by Aleksander Molak, 20220203.
"I love Murphy’s style of writing and I find it clear and appealing even when he discusses complex topics"
Endorsements

"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,
information theory,
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 musthave for anyone interested in gaining a deep understanding of machine learning."
 Chris Bishop,
Microsoft Research.

"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 wellrounded, uptodate, 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
bookwhich 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 facelift!
'Probabilistic Machine Learning: An Introduction' is the most
comprehensive and accessible book on modern machine learning by a
large margin.
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,
U. Amsterdam

"Prof Murphy's 2012 book was a triumph, covering both basic material
and also the stateoftheart. 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
"This book provides the
essential foundations for both research and practice in modern
scalable machine learning. It unifies and simplifies many of the most
important methods, giving its readers the insight to understand them
and the tools to expand them."  David Blei, Columbia U.
 "The book is really good."
 Bernhard Scholkopf, U. Tuebingen
Acknowledgements
I would like to thank the following people for helping with this book.
 People who helped write some of the sections:
Sami AbuElHaija,
Mathieu Blondel,
Ines Chami,
Krzysztof Choromanski,
Zico Kolter,
Frederick Kunster,
Si Yi Meng,
Aaron Mishkin,
Byran Perozzi,
Colin Raffel,
Mark Schmidt,
Sharan Vaswani.
 People who helped proofread: John Fearns, Peter Cerno, and many other people
listed in the github issues page.
 People who have helped with the code: Mahmoud Soliman,
Aleyna Kara, Gerardo DuránMartín, Srikar Jilugu, Drishti Patel, Ming Liang Ang,
Zeel Patel, Karm Patel, Nitish Sharma, Ankita Kumari Jain, Nipun Batra
and other people listed on the
github page.