Machine Learning – A Probabilistic Perspective – Kevin P.Murphy

With the ever increasing amounts of data in electronic form, the need for automated methods for data analysis continues to grow. The goal of machine learning is to develop methods that can automatically detect patterns in data, and then to use the uncovered patterns to predict future data or other outcomes of interest. Machine learning is thus closely related to the fields of statistics and data mining, but differs slightly in terms of its emphasis and terminology. This book provides a detailed introduction to the field, and includes worked examples drawn from application domains such as molecular biology, text processing, computer vision, and robotics.

Target audience
This book is suitable for upper-level undergraduate students and beginning graduate students in computer science, statistics, electrical engineering, econometrics, or any one else who has the appropriate mathematical background. Specifically, the reader is assumed to already be familiar with basic multivariate calculus, probability, linear algebra, and computer programming. Prior exposure to statistics is helpful but not necessary.

A probabilistic approach
This books adopts the view that the best way to make machines that can learn from data is to use the tools of probability theory, which has been the mainstay of statistics and engineering for centuries. Probability theory can be applied to any problem involving uncertainty. In machine learning, uncertainty comes in many forms: what is the best prediction (or decision) given some data? what is the best model given some data? what measurement should I perform next? etc. The systematic application of probabilistic reasoning to all inferential problems, including inferring parameters of statistical models, is sometimes called a Bayesian approach. However, this term tends to elicit very strong reactions (either positive or negative, depending on who you ask), so we prefer the more neutral term “probabilistic approach”. Besides, we will often use techniques such as maximum likelihood estimation, which are not Bayesian methods, but certainly fall within the probabilistic paradigm. Rather than describing a cookbook of different heuristic methods, this book stresses a princi- pled model-based approach to machine learning. For any given model, a variety of algorithms can often be applied. Conversely, any given algorithm can often be applied to a variety of models. This kind of modularity, where we distinguish model from algorithm, is good pedagogy and good engineering. We will often use the language of graphical models to specify our models in a concise and intuitive way. In addition to aiding comprehension, the graph structure aids in developing eflcient algorithms, as we will see. However, this book is not primarily about graphical models; it is about probabilistic modeling in general.

A practical approach
Nearly all of the methods described in this book have been implemented in a MATLAB software package called PMTK, which stands for probabilistic modeling toolkit. This is freely available from (the digit 3 refers to the third edition of the toolkit, which is the one used in this version of the book). There are also a variety of supporting files, written by other people, available at These will be downloaded automatically, if you follow the setup instructions described on the PMTK website. MATLAB is a high-level, interactive scripting language ideally suited to numerical computation and data visualization, and can be purchased from Some of the code requires the Statistics toolbox, which needs to be purchased separately. There is also a free version of Matlab called Octave, available at, which supports most of the functionality of MATLAB. Some (but not all) of the code in this book also works in Octave. See the PMTK website for details. PMTK was used to generate many of the figures in this book; the source code for these figures is included on the PMTK website, allowing the reader to easily see the effects of changing the data or algorithm or parameter settings. The book refers to files by name, e.g., naiveBayesFit. In order to find the corresponding file, you can use two methods: within Matlab you can type which naiveBayesFit and it will return the full path to the file; or, if you do not have Matlab but want to read the source code anyway, you can use your favorite search engine, which should return the corresponding file from the website. Details on how to use PMTK can be found on the website, which will be udpated over time. Details on the underlying theory behind these methods can be found in this book.

A book this large is obviously a team effort. I would especially like to thank the following people: my wife Margaret, for keeping the home fires burning as I toiled away in my oflce for the last six years; Matt Dunham, who created many of the figures in this book, and who wrote much of the code in PMTK; Baback Moghaddam, who gave extremely detailed feedback on every page of an earlier draft of the book; Chris Williams, who also gave very detailed feedback; Cody Severinski and Wei-Lwun Lu, who assisted with figures; generations of UBC students, who gave helpful comments on earlier drafts; Daphne Koller, Nir Friedman, and Chris Manning, for letting me use their latex style files; Stanford University, Google Research and Skyline College for hosting me during part of my sabbatical; and various Canadian funding agencies (NSERC, CRC and CIFAR) who have supported me financially over the years. In addition, I would like to thank the following people for giving me helpful feedback on parts of the book, and/or for sharing figures, code, exercises or even (in some cases) text: David Blei, Hannes Bretschneider, Greg Corrado, Arnaud Doucet, Mario Figueiredo, Nando de Freitas, Mark Girolami, Gabriel Goh, Tom Griflths, Katherine Heller, Geoff Hinton, Aapo Hyvarinen, Tommi Jaakkola, Mike Jordan, Charles Kemp, Emtiyaz Khan, Bonnie Kirkpatrick, Daphne Koller, Zico Kolter, Honglak Lee, Julien Mairal, Andrew McPherson, Tom Minka, Ian Nabney, Arthur Pope, Carl Rassmussen, Ryan Rifkin, Ruslan Salakhutdinov, Mark Schmidt, Daniel Selsam, David Sontag, Erik Sudderth, Josh Tenenbaum, Kai Yu, Martin Wainwright, Yair Weiss.

Related posts:

Python Machine Learning Cookbook - Practical solutions from preprocessing to Deep Learning - Chris A...
Artificial Intelligence - A Very Short Introduction - Margaret A.Boden
Foundations of Machine Learning second edition - Mehryar Mohri & Afshin Rostamizadeh & Ameet Talwalk...
Neural Networks and Deep Learning - Charu C.Aggarwal
Deep Learning and Neural Networks - Jeff Heaton
TensorFlow for Deep Learning - Bharath Ramsundar & Reza Bosagh Zadeh
Deep Learning dummies second edition - John Paul Mueller & Luca Massaronf
Machine Learning - An Algorithmic Perspective second edition - Stephen Marsland
Introduction to the Math of Neural Networks - Jeff Heaton
Deep Learning with Python - Francois Cholletf
Hands-On Machine Learning with Scikit-Learn and TensorFlow - Aurelien Geron
Natural Language Processing in action - Hobson Lane & Cole Howard & Hannes Max Hapke
Deep Learning with Hadoop - Dipayan Dev
Artificial Intelligence by example - Denis Rothman
Introduction to Deep Learning - Eugene Charniak
Python Data Structures and Algorithms - Benjamin Baka
Deep Learning Illustrated - A visual, Interactive Guide to Arficial Intelligence First Edition - Jon...
Data Science and Big Data Analytics - EMC Education Services
Generative Deep Learning - Teaching Machines to Paint, Write, Compose and Play - David Foster
Python 3 for Absolute Beginners - Tim Hall & J.P Stacey
Deep Learning with Python - Francois Chollet
Coding Theory - Algorithms, Architectures and Application
Python Deep Learning Cookbook - Indra den Bakker
Deep Learning with Applications Using Python - Navin Kumar Manaswi
Python Data Analytics with Pandas, NumPy and Matplotlib - Fabio Nelli
Java Deep Learning Essentials - Yusuke Sugomori
Neural Networks - A visual introduction for beginners - Michael Taylor
Deep Learning in Python - LazyProgrammer
Deep Learning with Python - A Hands-on Introduction - Nikhil Ketkar
Building Machine Learning Systems with Python - Willi Richert & Luis Pedro Coelho
Deep Learning with Keras - Antonio Gulli & Sujit Pal
Deep Learning for Natural Language Processing - Jason Brownlee