Index / 001 EN
Probabilistic Machine Learning: An Introduction cover

Computer Science

Computer Science

Probabilistic Machine Learning: An Introduction

Kevin P. Murphy

A comprehensive introduction to machine learning, including deep learning, presented through probabilistic modelling and Bayesian decision theory. Murphy rewrote his earlier Machine Learning: A Probabilistic Perspective as two volumes; this first volume covers the foundations and core methods. The author's official site offers a free PDF alongside the printed book.

Prerequisites: Linear algebra, multivariable calculus, probability and some programming in Python; the opening chapters review the necessary mathematics.

Difficulty Level
Intermediate
Academic Level
Undergraduate
machine learningprobabilistic modelingdeep learningbayesian inferenceTextbook

01 / Reading Guide

Reading Guide

Citation

Murphy, K. P. (2022). Probabilistic Machine Learning: An Introduction. MIT Press. Free official edition: https://probml.github.io/pml-book/book1.html

Chapter Summary

Chapter 1: Introduction

The introduction defines machine learning with Mitchell's task–experience–performance formulation and explains the book's stance: treat all unknown quantities as random variables, because probability is the right basis for decisions under uncertainty and a common language with other sciences. It surveys supervised learning (classifying iris flowers, polynomial regression, overfitting and generalization), unsupervised learning (clustering, latent factors, self-supervised learning), reinforcement learning, and common datasets and preprocessing. A closing discussion relates ML to statistics, data science and AI, outlines the five parts of the book, and raises caveats about reward hacking and the alignment problem.

Chapters 2–3: Probability: Univariate Models; Probability: Multivariate Models

Part I, "Foundations", begins with probability. Chapter 2 contrasts frequentist and Bayesian interpretations, then covers random variables, Bayes' rule, the Bernoulli, binomial, categorical, multinomial and Gaussian distributions, other common distributions and transformations of random variables. Chapter 3 extends this to joint distributions, covariance and correlation, the multivariate Gaussian, linear Gaussian systems, the exponential family, mixture models and an introduction to probabilistic graphical models.

Chapter 4: Statistics

This chapter treats learning as parameter estimation: maximum likelihood, empirical risk minimization, other estimators such as the method of moments, regularization (including MAP estimation and validation sets), Bayesian statistics with conjugate priors, and frequentist statistics with sampling distributions, the bootstrap and confidence intervals.

Chapter 5: Decision Theory

Building on posterior inference, the chapter shows how to turn beliefs into actions with loss functions, using medical treatment and classification examples. It covers Bayesian decision theory (including ROC and precision–recall analysis), model selection, frequentist decision theory and risk, empirical risk minimization and generalization, and frequentist hypothesis testing.

Chapter 6: Information Theory

A short chapter introduces entropy, relative entropy (KL divergence) and mutual information, with their properties and uses in machine learning.

Chapters 7–8: Linear Algebra; Optimization

Chapter 7 summarizes the linear algebra used throughout: notation, matrix multiplication and inversion, eigenvalue and singular value decompositions, other decompositions, solving linear systems and matrix calculus. Chapter 8 presents continuous optimization for model fitting: first-order and second-order methods, stochastic gradient descent and its variants, constrained optimization, proximal gradient methods, bound optimization (including EM) and derivative-free methods.

Chapters 9–10: Linear Discriminant Analysis; Logistic Regression

Part II, "Linear Models", starts with generative classifiers: Gaussian discriminant analysis, naive Bayes and a comparison of generative and discriminative approaches. Chapter 10 develops binary and multinomial logistic regression, with maximum likelihood fitting, regularization, robust variants and Bayesian logistic regression.

Chapters 11–12: Linear Regression; Generalized Linear Models

Chapter 11 covers least squares, ridge and lasso regression, regression splines, robust regression and Bayesian linear regression. Chapter 12 unifies these models as generalized linear models built on the exponential family, discusses link functions and maximum likelihood fitting, and ends with a worked example on predicting insurance claims.

Chapters 13–15: Neural Networks for Tabular Data; Neural Networks for Images; Neural Networks for Sequences

Part III, "Deep Neural Networks", introduces multilayer perceptrons as learned feature transformations, then backpropagation, training issues (such as vanishing gradients and learning rates) and regularization. Chapter 14 covers convolutional networks: common layers, image-classification architectures, other forms of convolution, other vision tasks and generating images by inverting networks. Chapter 15 covers recurrent networks, one-dimensional convolutions, attention, transformers, efficient transformers and language models used for unsupervised representation learning.

Chapters 16–18: Exemplar-based Methods; Kernel Methods; Trees, Forests, Bagging, and Boosting

Part IV, "Nonparametric Models", begins with K-nearest-neighbour classification, learned distance metrics and kernel density estimation. Chapter 17 introduces Mercer kernels, Gaussian processes and support vector machines. Chapter 18 covers classification and regression trees, ensemble learning, bagging, random forests, boosting and methods for interpreting tree ensembles.

Chapter 19: Learning with Fewer Labeled Examples

Part V, "Beyond Supervised Learning", opens with ways to cope with limited labels: data augmentation, transfer learning, semi-supervised learning, active learning, meta-learning, few-shot learning and weakly supervised learning.

Chapters 20–21: Dimensionality Reduction; Clustering

Chapter 20 develops principal components analysis, factor analysis, autoencoders, manifold learning methods and word embeddings. Chapter 21 discusses evaluating clusterings, hierarchical agglomerative clustering, K-means, mixture-model clustering, spectral clustering and biclustering.

Chapters 22–23: Recommender Systems; Graph Embeddings

Chapter 22 treats recommender systems with explicit and implicit feedback, side information and the exploration–exploitation trade-off. Chapter 23 presents graph embeddings as an encoder–decoder problem, covering shallow embeddings, graph neural networks, deep graph embeddings and applications.

Appendix A: Notation

The appendix collects the notation and abbreviations used throughout the book.

Key Concepts

Chapter 1: Introduction

  • Probabilistic perspective: modelling predictions and parameters as random variables with distributions, to quantify uncertainty.
  • Overfitting and generalization: a model that fits training data too closely may predict new data poorly, which is why test error matters.

Chapters 2–3: Probability

  • Bayes' rule: the formula for updating a prior belief into a posterior after observing data.
  • Multivariate Gaussian: the central continuous distribution over vectors, defined by a mean and a covariance matrix.
  • Exponential family: a broad family of distributions with convenient sufficient statistics, the basis of generalized linear models.

Chapters 4–6: Statistics, Decision Theory and Information Theory

  • Maximum likelihood estimation: choosing parameters that make the observed data most probable.
  • Regularization and MAP estimation: penalizing complex parameter settings, equivalent to adding a prior.
  • Bayesian decision theory: choosing the action that minimizes expected loss under the posterior.
  • KL divergence: a measure of how one probability distribution differs from another.

Chapters 7–8: Linear Algebra and Optimization

  • Singular value decomposition: factoring a matrix into orthogonal and diagonal parts, used for least squares and PCA.
  • Stochastic gradient descent: optimizing a loss using noisy gradients computed on mini-batches of data.

Chapters 9–12: Linear Models

  • Generative versus discriminative classifiers: modelling how features arise in each class, or modelling class probabilities directly.
  • Ridge and lasso: linear regression with ℓ2 or ℓ1 penalties, the latter producing sparse solutions.
  • Generalized linear model: a conditional exponential-family model whose natural parameter is linear in the inputs.

Chapters 13–15: Deep Neural Networks

  • Backpropagation: computing gradients of a network's loss efficiently with the chain rule.
  • Convolutional layer: a layer applying the same small learned filters across an image.
  • Attention and transformers: mechanisms that let each position in a sequence weigh information from other positions.

Chapters 16–18: Nonparametric Models

  • Gaussian process: a distribution over functions defined by a kernel, giving predictions with uncertainty.
  • Support vector machine: a kernel classifier that maximizes the margin between classes.
  • Boosting and random forests: ensembles of trees built sequentially to correct errors, or in parallel on randomized data and features.

Chapters 19–23: Beyond Supervised Learning

  • Transfer learning: reusing a model trained on one task or dataset to help with another that has few labels.
  • Principal components analysis: projecting data onto the directions of greatest variance for compression and visualization.
  • Matrix factorization for recommendation: predicting missing ratings from low-dimensional user and item factors.

Critical Analysis

Strengths

  • One unifying lens. As the preface explains, the book presents machine learning through probabilistic modelling and Bayesian decision theory, so methods from naive Bayes to neural networks and Gaussian processes are connected through likelihoods, priors and losses rather than presented as unrelated recipes.
  • Self-contained foundations. Part I includes probability, statistics, decision theory, information theory, linear algebra and optimization, material the preface says was added to make the book more useful to students. Readers can look up background in the same notation used for the methods.
  • Breadth with modern coverage. In about 800 pages the book runs from classical linear models to transformers, graph neural networks, few-shot learning and recommender systems, reflecting the field around 2021.
  • Reproducible figures and online support. Figures are generated by Python notebooks (using libraries such as NumPy, scikit-learn, JAX and PyTorch) that open in Google Colab, and solutions to many exercises are posted online.

Limitations

  • Dense and mathematically demanding. The book moves quickly through derivations, and comfort with linear algebra, multivariable calculus and probability is assumed despite the review chapters; beginners may find it hard as a first text.
  • Breadth over depth in places. Many sections, especially those starred as advanced and those in Part V, are brief overviews pointing to the sequel or the literature rather than full treatments.
  • Uneven exercises. Exercises appear only at the end of some chapters, and several chapters (for example on neural networks for images and sequences, trees and clustering) have none.
  • Some topics deferred to the sequel. Generative models, variational inference, reinforcement learning in depth and causality are largely left to Probabilistic Machine Learning: Advanced Topics.

Where It Fits in the Course

In this machine learning and AI list, Murphy is the text that develops the probabilistic derivations. James et al.'s An Introduction to Statistical Learning with Applications in Python is the gentler companion, generally described as covering similar supervised and unsupervised methods with less mathematics and hands-on labs; students new to the subject can work through it first and then turn to Murphy for the probabilistic derivations, Bayesian treatment and deep learning chapters. Mitchell's Artificial Intelligence: A Guide for Thinking Humans is a non-technical overview that can provide context but not technical preparation.

Russell and Norvig's Artificial Intelligence: A Modern Approach covers AI more broadly, including search, logic and planning, and is complementary rather than overlapping; Murphy's introduction itself contrasts hand-programmed AI with learning. Szeliski's Computer Vision builds on the kind of material in Murphy's Chapter 14 for students specializing in vision.

How to Use This Book

The book suits upper-level undergraduates and graduate students in computer science, statistics or engineering who have taken linear algebra, multivariable calculus and probability and can program in Python. Chapters 2–8 can be used as a reference or review rather than read in full before starting.

For a one-semester introduction, a practical path is Chapter 1, selected parts of Chapters 2–5, Chapter 8 (gradient methods), Chapters 9–11, Chapter 13, and either Chapters 14–15 or 17–18, finishing with Chapters 20–21. Sections and chapters marked with an asterisk are flagged in the preface as skippable in an introductory course. Work the exercises where they exist, using the online solutions to check, and run the linked Colab notebooks to reproduce and modify figures. The sequel, Probabilistic Machine Learning: Advanced Topics, continues where this volume stops.

Edition and Sources

This guide is based on the free online version of Probabilistic Machine Learning: An Introduction dated 18 April 2025 (book1.pdf, CC BY-NC-ND licence; print edition MIT Press 2022), downloaded via the author's official book page https://probml.github.io/pml-book/book1.html. It draws on the preface and acknowledgements, the brief and full tables of contents with every section title, Chapter 1's opening section and closing discussion (structure of the book and caveats) in full, and the opening sections of all 23 chapters, with an exercise count for the whole book.