BSCS and MS students can use this guide to study “Pattern Recognition and Machine Learning” by Christopher M. Bishop, published by Springer in 2006. It is a widely used textbook on probabilistic machine learning. Microsoft Research, where the author worked when he wrote it, now offers the full book as a free PDF on its official page, and it stays on that page rather than here.
The book has 14 chapters. It starts with probability, decision theory and information theory, then covers linear regression and classification, neural networks, kernel methods, support vector machines, graphical models, EM, variational inference, sampling, principal component analysis and other continuous latent variable models, hidden Markov models and model combination. Exercises close every chapter. It is a classic, and its core ideas still hold up, but it was written before deep learning took off. The maths level is also high, so be ready for multivariate calculus, linear algebra and probability.
Book Overview
| Course | Machine Learning / Pattern Recognition |
| Degree Programs | BSCS, MS (Computer Science / Machine Learning) |
| Level | Advanced undergraduate and graduate |
| Edition | First edition, 2006 (preface dated February 2006) |
| Author | Christopher M. Bishop |
| Publisher | Springer Science+Business Media, LLC (series: Information Science and Statistics) |
| ISBN | ISBN-10 0-387-31073-8; ISBN-13 978-0387-31073-2 (as printed in the book) |
| Total Chapters | 14 chapters plus Appendices A–E (printed length 738 pages) |
| Exercises | 431 exercises, graded by difficulty, at the end of the chapters |
| Language | English |
| Format | PDF — free from the official Microsoft Research page |
Chapter List
Chapter 1: Introduction
Difficulty: Medium · Key topics: supervised and unsupervised learning, polynomial curve fitting, over-fitting, regularization, Bayes’ theorem, Gaussian distribution, curse of dimensionality, decision theory, entropy
The chapter starts with handwritten digit recognition to explain training sets, generalization, classification, regression, clustering and reinforcement learning. It then uses one running example, fitting a polynomial to ten noisy points taken from a sine curve, to show over-fitting, regularization and model selection by cross-validation. A self-contained tour of probability follows: sum and product rules, Bayes’ theorem, densities, expectations, the Gaussian and Bayesian curve fitting. The chapter closes with the curse of dimensionality, decision theory (misclassification rate, expected loss, the reject option) and information theory (entropy, relative entropy, mutual information).
Key Points:
- A model is tuned on a training set, and its ability to classify new examples correctly is called generalization, which is the central goal.
- In the curve fitting example the order-9 polynomial (M = 9) reaches zero training error on ten points yet generalizes badly, which is over-fitting.
- Adding a penalty on the size of the weights (regularization) and choosing its strength by cross-validation controls over-fitting.
- The sum rule and the product rule are the two equations behind all the probabilistic reasoning in the book, and Bayes’ theorem follows from them.
- Decision theory splits a problem into an inference stage (learn the posterior probabilities) and a decision stage (use a loss function to choose an action).
- Entropy measures the average surprise of a variable, and relative entropy KL(p||q) is the extra information needed when q is used in place of the true p.
Practice Tip: Generate ten points from sin(2*pi*x) plus small noise, fit polynomials of order 0, 1, 3 and 9 with NumPy, and compare training and test errors. The order-9 curve will pass through every training point while its test error climbs.
Common Mistake: Choosing the model with the lowest training error. The chapter’s own example shows that the most flexible model has zero training error and the worst predictions on new data.
Important Questions:
- What is over-fitting and how can it be controlled? It is when a model fits the noise in the training set and predicts new data poorly; it is controlled with more data, a regularization term, or by choosing model complexity with validation or cross-validation.
- What is the difference between the inference stage and the decision stage? Inference learns the posterior probabilities of the classes from data; decision then uses those probabilities together with a loss function to assign each input to a class.
Chapter 2: Probability Distributions
Difficulty: Medium · Key topics: Bernoulli and binomial, beta, multinomial, Dirichlet, Gaussian, conjugate priors, Student’s t, mixtures of Gaussians, exponential family, kernel density estimation, nearest neighbours
This chapter studies the standard distributions that act as building blocks for density estimation, and uses each one to compare frequentist and Bayesian estimation on a simple model. Binary and multinomial variables lead to the beta and Dirichlet distributions as conjugate priors. A long section on the Gaussian covers conditional and marginal distributions, Bayes’ theorem for Gaussian variables, maximum likelihood, sequential estimation with the Robbins-Monro algorithm, Bayesian inference, Student’s t-distribution, periodic variables and mixtures. The chapter ends with the exponential family, noninformative priors and nonparametric methods: kernel density estimators and nearest neighbours.
Key Points:
- A conjugate prior gives a posterior of the same form as the prior: beta for Bernoulli and binomial data, Dirichlet for multinomial data.
- If two sets of variables are jointly Gaussian, both the conditional and the marginal distribution of one set are again Gaussian.
- The maximum likelihood estimate of a Gaussian covariance is biased, and multiplying by N/(N-1) corrects it.
- Student’s t-distribution arises by integrating out the precision of a Gaussian, and it is more robust to outliers than a single Gaussian.
- The Old Faithful data set (272 measurements) shows why one Gaussian is not enough and motivates mixtures of Gaussians.
- Kernel density estimators and nearest-neighbour methods are nonparametric: they keep the data instead of fitting a small set of parameters.
Memory Tip: Learn the conjugate pairs as a table: Bernoulli or binomial with beta, multinomial with Dirichlet, Gaussian mean with Gaussian, Gaussian precision with gamma. The prior wears the same shape as the likelihood.
Common Mistake: Treating the value of a probability density as a probability. A density can be larger than 1; only its integral over an interval is a probability.
Important Questions:
- What is a conjugate prior and why is it useful? It is a prior for which the posterior has the same functional form, so Bayesian updating reduces to adding counts or updating a few parameters in closed form.
- Why is a single Gaussian often a poor model, and what fixes it? It is unimodal and cannot capture several clumps in the data; a mixture of Gaussians can.
Chapter 3: Linear Models for Regression
Difficulty: Medium · Key topics: basis functions, least squares, regularization, bias-variance decomposition, Bayesian linear regression, predictive distribution, equivalent kernel, evidence approximation
The chapter takes up supervised learning with regression, predicting continuous targets from a linear combination of fixed basis functions. That keeps the model linear in its parameters but nonlinear in the inputs. It derives maximum likelihood and least squares, explains the geometry of the least-squares solution, and adds sequential learning and regularized least squares. The bias-variance decomposition is shown with 100 data sets of 25 points each. The second half is Bayesian: a Gaussian prior over the weights, the predictive distribution, the equivalent kernel, Bayesian model comparison, the evidence approximation for setting hyperparameters, and the limits of fixed basis functions.
Key Points:
- The model is a weighted sum of basis functions and is linear in the weights, which gives a closed-form least-squares solution.
- Maximum likelihood under Gaussian noise is the same as minimizing the sum-of-squares error, and geometrically the fit is a projection of the target vector onto the space spanned by the basis functions.
- Quadratic regularization is weight decay (ridge); the lasso penalty gives sparse solutions.
- Expected squared loss splits into bias squared, variance and noise, so a flexible model has low bias but high variance.
- With a Gaussian prior on the weights the posterior is Gaussian, and the predictive variance has one term for noise and one for uncertainty in the weights.
- The evidence (marginal likelihood) can set the regularization strength and compare models without a separate validation set.
Memory Tip: Think of darts. Bias is how far the average of many throws lands from the bullseye; variance is how widely the throws are scattered around their own average.
Common Mistake: Believing linear regression means a straight line. It only has to be linear in the weights, so polynomials and Gaussian basis functions are still linear models.
Important Questions:
- Why does a more flexible model have lower bias but higher variance? It can follow the true function closely on average, but each fitted curve then depends strongly on the particular noisy training set it saw.
- What is the evidence used for in Bayesian linear regression? It is the likelihood after integrating out the weights; maximizing it sets the hyperparameters and lets you compare models using only the training data.
Chapter 4: Linear Models for Classification
Difficulty: Medium · Key topics: discriminant functions, Fisher’s linear discriminant, perceptron, generative models, logistic regression, softmax, IRLS, probit, Laplace approximation, BIC
Here the decision surfaces are hyperplanes in the input space. The chapter starts with discriminant functions for two and several classes, least squares for classification, Fisher’s linear discriminant and the perceptron algorithm. It then shows how Gaussian class-conditional densities give logistic sigmoid and softmax posteriors in a probabilistic generative model, with discrete features and the exponential family as extensions. Probabilistic discriminative models follow: logistic regression fitted by iterative reweighted least squares, multiclass logistic regression, probit regression and canonical link functions. The chapter ends with the Laplace approximation, the Bayesian information criterion and Bayesian logistic regression.
Key Points:
- A linear discriminant y(x) = w^T x + w0 gives decision boundaries that are (D-1)-dimensional hyperplanes in D-dimensional input space.
- The perceptron convergence theorem says that if the classes are exactly linearly separable, the perceptron algorithm finds a solution in a finite number of steps.
- The Fisher criterion maximizes the separation of projected class means relative to the within-class spread.
- Gaussian class densities with a shared covariance give a logistic sigmoid (two classes) or softmax (K classes) posterior.
- A Gaussian generative model needs 2M means plus M(M+1)/2 covariance parameters, while logistic regression needs only M parameters.
- Logistic regression has no closed form, but its error function has a unique minimum, so the Newton-Raphson (IRLS) update converges to it.
Practice Tip: Fit scikit-learn’s LogisticRegression and LinearDiscriminantAnalysis on the same two-class data set and plot both decision boundaries. When the classes are roughly Gaussian with similar covariance the two lines will be close.
Common Mistake: Using least squares on 1-of-K targets and reading the outputs as probabilities. They are not limited to the range 0 to 1, and the fit is sensitive to outliers, which is why the chapter moves on to logistic regression.
Important Questions:
- Why is logistic regression trained iteratively? The sigmoid makes the error function nonlinear in the weights, so there is no closed-form solution; IRLS applies Newton-Raphson updates until convergence.
- What is the difference between generative and discriminative models? A generative model fits p(x|class) and the priors and then applies Bayes’ theorem; a discriminative model fits the posterior p(class|x) directly with fewer parameters.
Chapter 5: Neural Networks
Difficulty: Hard · Key topics: feed-forward networks, weight-space symmetries, error backpropagation, gradient descent, Hessian matrix, early stopping, tangent propagation, convolutional networks, mixture density networks, Bayesian neural networks
The chapter presents the multilayer perceptron as a model with a fixed number of adaptive basis functions, and notes that its error function is no longer convex. It covers feed-forward network functions and weight-space symmetries, training with error functions, the local quadratic approximation and gradient descent. Error backpropagation is derived in general form and then for a simple example, followed by its efficiency and the Jacobian matrix. A long section on the Hessian matrix gives several approximations and exact methods. The chapter then discusses regularization (weight decay, early stopping, invariances, tangent propagation, convolutional networks, soft weight sharing), mixture density networks and Bayesian neural networks.
Key Points:
- Hidden units are usually sigmoidal (logistic or tanh), and a two-layer network with enough hidden units can approximate any continuous function, so such networks are called universal approximators.
- For M hidden tanh units there are M!2^M equivalent weight vectors, which is the weight-space symmetry.
- Using gradient information cuts the cost of locating a minimum from O(W^3) to O(W^2) operations for W weights.
- Backpropagation evaluates all derivatives of the error in O(W) operations by passing information forwards and then backwards.
- Comparing backpropagation with central finite differences is a standard way to check that your gradient code is correct.
- Convolutional networks build in translation invariance through local receptive fields, weight sharing and subsampling.
- Mixture density networks model a multimodal p(t|x), which matters for inverse problems.
Practice Tip: Write a tiny two-layer tanh network in NumPy, train it on the sine data from Chapter 1, and verify your backpropagation gradient against central finite differences on a few weights.
Common Mistake: Expecting this chapter to be a modern deep learning guide. It covers shallow networks with sigmoidal units, and it does not include ReLU units, very deep architectures, GPU training or modern optimizers.
Important Questions:
- Why is backpropagation efficient? It reuses the forward-pass activations and propagates error terms backwards, so all W derivatives cost O(W) operations instead of O(W^2) for naive numerical differentiation.
- What does early stopping do? Training is halted when the error on a validation set starts to rise, which limits the effective complexity of the network and acts like regularization.
Chapter 6: Kernel Methods
Difficulty: Hard · Key topics: dual representation, kernel function, Gram matrix, constructing kernels, radial basis functions, Nadaraya-Watson, Gaussian processes, automatic relevance determination
This chapter introduces memory-based methods, where the training data is kept for prediction, and shows that many linear models have a dual form in which predictions use a kernel k(x, x’) = phi(x)^T phi(x’) evaluated at training points. It explains how to build valid kernels and combine them, then covers radial basis function networks and the Nadaraya-Watson kernel regression model. The main part develops Gaussian processes: linear regression revisited as a process over functions, regression with a covariance function, learning hyperparameters, automatic relevance determination, classification with the Laplace approximation, and the link to neural networks.
Key Points:
- In the dual form, predictions are a linear combination of kernel values between the new input and the training inputs, built from the Gram matrix K.
- Kernel substitution means replacing a scalar product x^T x’ in an algorithm with another kernel, as the book later does for PCA.
- A function is a valid kernel when its Gram matrix is symmetric and positive semidefinite for every choice of points.
- The Gaussian kernel corresponds to a feature space of infinite dimensionality.
- A Gaussian process defines a distribution over functions through its covariance function, and regression prediction needs the inverse of an N x N matrix, which costs O(N^3).
- Automatic relevance determination gives each input its own length scale, so irrelevant inputs can be switched off.
Practice Tip: Build a Gram matrix with a Gaussian kernel on a grid of 100 points, add a tiny value to the diagonal, and draw three samples with numpy.random.multivariate_normal. Change the length scale and watch the sample functions get smoother or wigglier.
Common Mistake: Treating any similarity score as a kernel. If the Gram matrix is not positive semidefinite, the guarantees behind kernel methods no longer hold.
Important Questions:
- What makes a function a valid kernel? It must equal an inner product in some feature space, which is equivalent to requiring a symmetric positive semidefinite Gram matrix for any set of inputs.
- What is a Gaussian process? It is a distribution over functions in which any finite set of function values is jointly Gaussian, with its mean and covariance given by a kernel.
Chapter 7: Sparse Kernel Machines
Difficulty: Hard · Key topics: maximum margin, support vector machine, slack variables, Lagrange multipliers, SVM for regression, computational learning theory, relevance vector machine, sparsity
Kernel methods in Chapter 6 need the kernel for every pair of training points, so this chapter looks for sparse solutions that use only a subset. It builds the support vector machine from the maximum margin classifier, solves the dual quadratic program, handles overlapping classes with slack variables, relates the SVM to logistic regression, and extends it to several classes, to regression with the epsilon-insensitive error and to computational learning theory. The second half introduces the relevance vector machine, a Bayesian sparse linear model, for regression, an analysis of why it is sparse, and classification.
Key Points:
- The SVM chooses the decision boundary with the largest margin, and the final classifier depends only on the support vectors.
- Training an SVM is a convex optimization problem, so every local solution is also a global one.
- A quadratic program in M variables has general cost O(M^3), so moving to the dual form, which has one variable per training point, pays off when the feature space is large.
- With overlapping classes, slack variables allow some points inside the margin, with the penalty strength set by C.
- The SVM gives decisions, not posterior probabilities; the RVM gives probabilistic outputs and is usually much sparser.
- The RVM puts an automatic relevance determination prior on the weights, which drives most of them to zero, at the cost of a nonconvex optimization.
Practice Tip: Train scikit-learn’s SVC on a two-moons data set with several values of C and count the support vectors with clf.support_vectors_.shape. Small C gives a wide margin with more support vectors.
Common Mistake: Reading the raw SVM output as a probability. It is a distance-like score; the chapter notes that probabilities need an extra step or a different model such as the RVM.
Important Questions:
- What are support vectors? They are the training points that lie on or inside the margin; only they have nonzero multipliers and determine the classifier.
- How does the relevance vector machine differ from the SVM? It is Bayesian, gives posterior probabilities and uses far fewer basis functions, but training involves a nonconvex optimization rather than a convex one.
Chapter 8: Graphical Models
Difficulty: Hard · Key topics: Bayesian networks, conditional independence, d-separation, Markov random fields, factor graphs, sum-product algorithm, max-sum algorithm, loopy belief propagation
The chapter introduces diagrams for probability distributions. Bayesian networks (directed graphs) are explained with the polynomial regression example, ancestral sampling, discrete variables and linear-Gaussian models. A section on conditional independence uses three three-node graphs to motivate d-separation. Markov random fields (undirected graphs) are covered through conditional independence, factorization over cliques and an image de-noising illustration, along with their relation to directed graphs. The last section is inference: exact inference on a chain and on trees, factor graphs, the sum-product and max-sum algorithms, general graphs, loopy belief propagation and learning the graph structure.
Key Points:
- A directed graph factorizes the joint distribution as a product of each node’s conditional distribution given its parents.
- Observing a tail-to-tail or head-to-tail node blocks a path, while a head-to-head node blocks the path unless it or one of its descendants is observed.
- d-separation lets you read conditional independence directly off a directed graph.
- A Markov random field factorizes over cliques using positive potential functions, and the Hammersley-Clifford theorem links this to conditional independence.
- The sum-product algorithm computes marginals by message passing on trees and factor graphs, and the max-sum algorithm finds the most probable configuration.
- In the image de-noising example, iterated conditional modes restores an image in which 96% of pixels agree with the original.
Memory Tip: Common cause and chain are both blocked by observing the middle node. The collider (head-to-head) works the opposite way: observing it, or anything below it, opens the path.
Common Mistake: Forgetting the collider rule. Two independent causes become dependent once you observe their common effect, so conditioning on a collider can create dependence rather than remove it.
Important Questions:
- What is d-separation? It is a graphical test that says whether a set of nodes A is conditionally independent of a set B given C, by checking whether every path between them is blocked.
- When is the sum-product algorithm exact? On tree-structured graphs (and factor graphs without loops); for graphs with loops, loopy belief propagation gives only an approximation.
Chapter 9: Mixture Models and EM
Difficulty: Hard · Key topics: K-means, Gaussian mixture, latent variables, responsibilities, expectation-maximization, singularities, Bernoulli mixtures, general EM
The chapter shows how latent variables let simple components build complicated distributions and cluster data. It begins with the nonprobabilistic K-means algorithm and its use in image segmentation and compression. Mixtures of Gaussians are then written with a discrete latent variable, maximum likelihood is set up, and the EM algorithm is derived informally for Gaussian mixtures. A second view of EM uses the complete-data log likelihood, revisits Gaussian mixtures, relates EM to K-means, applies it to mixtures of Bernoulli distributions and to Bayesian linear regression, and finally gives a general treatment of EM with a lower-bound proof.
Key Points:
- K-means alternates between assigning each point to its nearest centre and moving each centre to the mean of its points, lowering the distortion measure each time.
- A Gaussian mixture is a weighted sum of Gaussians, and the responsibilities are the posterior probabilities that each component generated each point.
- Maximum likelihood for a Gaussian mixture has singularities: a component that collapses onto one data point makes the likelihood unbounded.
- EM alternates an E step (compute responsibilities) and an M step (re-estimate parameters), and each cycle increases the log likelihood or leaves it unchanged.
- K-means is a nonprobabilistic limit of EM for a mixture of Gaussians whose covariances are the same small multiple of the identity matrix.
- In general EM, the log likelihood splits into a lower bound plus a KL divergence between the latent distribution and its posterior.
Practice Tip: Implement EM for a two-component 1-D Gaussian mixture in NumPy and print the log likelihood each iteration. It should never go down, and starting from K-means centres usually helps it settle faster.
Common Mistake: Running K-means or EM once and trusting the result. Both converge only to a local optimum, so use several random starts and treat K as something to choose.
Important Questions:
- How does EM for Gaussian mixtures differ from K-means? K-means makes hard assignments of points to clusters; EM makes soft assignments through responsibilities and also learns covariances and mixing weights.
- Why can maximum likelihood fail for a Gaussian mixture? If one component’s mean sits exactly on a data point and its variance shrinks to zero, the likelihood grows without limit, giving a useless singular solution.
Chapter 10: Approximate Inference
Difficulty: Hard · Key topics: variational inference, lower bound, factorized approximation, variational Gaussian mixture, variational message passing, local variational bounds, variational logistic regression, expectation propagation
When the posterior over latent variables cannot be computed exactly, this chapter develops deterministic approximations. Variational inference is built on a lower bound and a restricted family of distributions, in particular factorized ones, with the univariate Gaussian as a worked case and a note on model comparison. The variational mixture of Gaussians is the main illustration, including its lower bound, predictive density and the choice of the number of components. Variational linear regression, exponential family models and variational message passing come next, then local variational bounds applied to logistic regression, and finally expectation propagation, with the clutter problem and EP on graphs.
Key Points:
- The log marginal likelihood equals the lower bound plus KL(q||p), so maximizing the bound is the same as minimizing the KL divergence from q to the true posterior.
- In the factorized (mean-field) approximation each factor is updated in turn from the expectation of the log joint distribution over the other factors.
- A factorized variational approximation tends to give a posterior that is too compact.
- In the variational Gaussian mixture, components that the data does not support are effectively pruned out automatically.
- Local variational methods bound a single awkward function, such as the logistic sigmoid, by a simpler one.
- Expectation propagation minimizes the reverse form of the KL divergence, KL(p||q), one factor at a time.
Memory Tip: Remember the two directions of KL: variational Bayes minimizes KL(q||p) and tends to be too compact, while expectation propagation uses KL(p||q). The first letter inside the brackets is the distribution that gets averaged over.
Common Mistake: Mixing up the direction of the KL divergence. KL(q||p) and KL(p||q) are different quantities and lead to different approximations.
Important Questions:
- What is the variational lower bound? It is a function of the approximating distribution q that sits below the log marginal likelihood, with the gap equal to the KL divergence between q and the true posterior.
- Why is the variational Gaussian mixture better behaved than maximum likelihood? The priors remove the singularities, and the Bayesian treatment automatically trades model complexity against fit, so unneeded components can be switched off.
Chapter 11: Sampling Methods
Difficulty: Hard · Key topics: Monte Carlo, rejection sampling, importance sampling, SIR, Markov chain Monte Carlo, Metropolis-Hastings, Gibbs sampling, slice sampling, hybrid Monte Carlo
This chapter covers approximate inference by numerical sampling. The core problem is to estimate an expectation by averaging a function over samples drawn from a distribution. Basic algorithms come first: transformation of standard distributions, rejection sampling, adaptive rejection sampling, importance sampling, sampling-importance-resampling and sampling inside EM. Markov chain Monte Carlo follows, with Markov chains and the Metropolis-Hastings algorithm. The chapter then covers Gibbs sampling, slice sampling and hybrid Monte Carlo, which uses Hamiltonian dynamics with a leapfrog discretization, and finishes with estimating the partition function.
Key Points:
- An expectation is approximated by the average of the function over L samples drawn from the distribution.
- Rejection sampling needs an envelope distribution scaled by a constant, and in high dimensions the rejection rate becomes impractical.
- Importance sampling estimates expectations without drawing exact samples, by weighting samples from a simpler proposal distribution.
- The Metropolis algorithm uses a random walk, so the distance travelled grows only as the square root of the number of steps.
- Gibbs sampling updates one variable at a time from its conditional distribution and is a special case of Metropolis-Hastings.
- Hybrid Monte Carlo uses gradient information and Hamiltonian dynamics to avoid random-walk behaviour, and most of these methods need the distribution only up to a normalizing constant.
Practice Tip: Write a random-walk Metropolis sampler for a mixture of two 1-D Gaussians. Try step sizes 0.1, 1 and 10 and compare the acceptance rate and the trace plot to see what too small and too large look like.
Common Mistake: Treating consecutive MCMC samples as independent. They are correlated, so thin the chain or account for correlation when judging how much information you really have.
Important Questions:
- Why is MCMC preferred to rejection sampling in high dimensions? Rejection and importance sampling degrade badly as the dimension grows, whereas a Markov chain only needs local moves and can still converge to the target distribution.
- What problem does hybrid Monte Carlo solve? It reduces the random-walk behaviour of the Metropolis algorithm by using gradients and momentum to make large moves with a high acceptance rate.
Chapter 12: Continuous Latent Variables
Difficulty: Hard · Key topics: principal component analysis, whitening, probabilistic PCA, EM for PCA, Bayesian PCA, factor analysis, kernel PCA, independent component analysis, autoassociative networks, nonlinear manifolds
This chapter swaps the discrete latent variable of Chapter 9 for a continuous one. Principal component analysis is derived in two equivalent ways, maximizing projected variance and minimizing reconstruction error, and is then used for compression, whitening and visualization. Probabilistic PCA turns it into a linear-Gaussian model with a closed-form maximum likelihood solution, an EM algorithm that tolerates missing values and a Bayesian version that chooses the number of components itself. Factor analysis changes only the noise term. Kernel PCA makes the method nonlinear, and the last section surveys independent component analysis, autoassociative networks, principal curves, MDS, LLE, Isomap and the generative topographic mapping.
Key Points:
- PCA keeps the M eigenvectors of the data covariance matrix S that have the largest eigenvalues, and the distortion left over equals the sum of the discarded eigenvalues.
- When there are fewer data points N than dimensions D, PCA is run on the N x N matrix XXT/N instead, which cuts the cost of the eigen-decomposition from O(D^3) to O(N^3).
- Whitening rescales the principal components to give zero mean and unit covariance; PCA ignores class labels, so unlike the Fisher discriminant it can leave classes overlapping.
- Probabilistic PCA writes x as Wz plus a mean plus isotropic Gaussian noise; its maximum likelihood noise variance is the average of the discarded eigenvalues, and it needs only DM + 1 – M(M-1)/2 covariance parameters, which grows linearly with D.
- The EM algorithm for PCA costs O(NDM) per cycle instead of O(ND^2) for the covariance matrix, can run on-line, and handles data that is missing at random.
- Bayesian PCA puts an ARD prior on the columns of W so surplus columns are driven to zero, while factor analysis uses a diagonal noise covariance and has no closed-form maximum likelihood solution.
- Kernel PCA replaces scalar products with a kernel and finds the eigenvectors of the centred N x N Gram matrix, so it can extract more than D nonlinear components; a linear kernel gives back ordinary PCA.
Practice Tip: Load a digits data set, centre it and use numpy.linalg.eigh on the covariance matrix. Plot the sorted eigenvalues, then reconstruct one digit from M = 1, 10 and 50 components and check that the squared error matches the sum of the discarded eigenvalues.
Common Mistake: Assuming that an autoassociative network with one hidden layer of nonlinear units gives nonlinear dimensionality reduction. The chapter shows its best solution is still the PCA subspace; you need extra nonlinear hidden layers, and then training can get stuck in local minima.
Important Questions:
- What are the two standard formulations of PCA? Choose the projection that maximizes the variance of the projected data, or the one that minimizes the mean squared reconstruction error. Both give the eigenvectors of the data covariance matrix with the M largest eigenvalues.
- How does probabilistic PCA differ from ordinary PCA and from factor analysis? Probabilistic PCA is a generative model with isotropic noise, so it has a likelihood, an EM algorithm and a Bayesian extension, and it reduces to PCA as the noise variance goes to zero. Factor analysis has the same form but gives each variable its own noise variance.
Chapter 13: Sequential Data
Difficulty: Hard · Key topics: Markov models, hidden Markov models, forward-backward algorithm, Viterbi algorithm, left-to-right HMM, linear dynamical systems, Kalman filter, particle filters
The chapter drops the assumption that data points are independent and identically distributed and looks at sequences such as speech spectrograms, time series and DNA. It starts with Markov models, then hidden Markov models: maximum likelihood by EM, the forward-backward algorithm for the E step, the sum-product view, scaling factors for numerical stability, the Viterbi algorithm for the best state sequence, and extensions such as left-to-right models. Linear dynamical systems follow, with inference (the Kalman filter and smoother), learning, extensions, and particle filters for systems that are not linear-Gaussian.
Key Points:
- In a first-order Markov model each observation depends only on the previous one.
- A state space model puts a Markov chain on latent variables; it is a hidden Markov model when they are discrete and a linear dynamical system when they are continuous and linear-Gaussian.
- The EM algorithm for the HMM is the Baum-Welch algorithm, with the forward-backward algorithm supplying the E step.
- The forward recursion multiplies many small probabilities, so scaling factors are introduced to keep the numbers well behaved.
- The Viterbi algorithm finds the most probable sequence of hidden states, for example the most likely phoneme sequence in speech recognition.
- The Kalman filter is the forward recursion for the linear dynamical system, the backward recursions are the Kalman smoother (RTS) equations, and particle filters use sampling when the model is not linear-Gaussian.
Practice Tip: Code the forward algorithm for a two-state HMM with discrete outputs. Run it on a long sequence once without scaling and once with scaling, and see the unscaled probabilities underflow to zero.
Common Mistake: Confusing the most probable state at each time step with the most probable state sequence. The forward-backward algorithm gives the first, the Viterbi algorithm gives the second, and they can disagree.
Important Questions:
- What does the forward-backward algorithm compute? The posterior marginals of the hidden states (and pairs of successive states) given the whole observation sequence, which is the E step when training an HMM with EM.
- How is a linear dynamical system related to an HMM? Both are state space models with the same graph; the HMM has discrete latent states, the linear dynamical system has continuous Gaussian ones.
Chapter 14: Combining Models
Difficulty: Medium · Key topics: Bayesian model averaging, committees, bagging, boosting, AdaBoost, decision trees, conditional mixture models, mixtures of experts
The final chapter asks how to get better performance by combining several models. It first separates Bayesian model averaging from model combination, then covers committees that average the predictions of several models and use bootstrap data sets for bagging. Boosting is explained through AdaBoost, which trains base classifiers in sequence, followed by minimizing the exponential error and a comparison of error functions. Tree-based models partition the input space with axis-aligned splits, and conditional mixture models soften those splits with mixtures of linear regression models, mixtures of logistic models and mixtures of experts.
Key Points:
- Bayesian model averaging weights models by their posterior probability and is not the same thing as combining models: only one model is assumed to have generated the data.
- A committee averages the predictions of several models, and the bias-variance trade-off explains why this can reduce error.
- Bagging trains each model on a bootstrap data set and averages the results.
- AdaBoost trains base classifiers in sequence, giving more weight to points the earlier ones got wrong.
- AdaBoost can be seen as sequential minimization of an exponential error function.
- Tree-based models such as CART use hard, axis-aligned splits, and mixtures of experts replace them with soft, input-dependent weighting.
Memory Tip: Bagging is a crowd voting in parallel, each member trained on a different resample. Boosting is a relay: each runner trains after the previous one, focusing on the mistakes it left behind.
Common Mistake: Treating Bayesian model averaging as an ensemble method. As the sample grows, the posterior concentrates on one model, so averaging reduces to selecting that model.
Important Questions:
- What is the difference between bagging and boosting? Bagging trains models independently on bootstrap resamples and averages them; boosting trains models one after another, reweighting the data so each focuses on earlier errors.
- What is a mixture of experts? A model in which a gating function, depending on the input, decides how much weight each expert model gets, giving soft input-dependent combination.
Appendices A-E: Data Sets, Distributions, Matrices, Variational Calculus and Lagrange Multipliers
Appendix · Difficulty: Medium · Key topics: MNIST, oil flow, Old Faithful, synthetic data, distribution reference, matrix identities, calculus of variations, Lagrange multipliers
The five appendices are short reference sections that support the chapters. Appendix A describes the data sets behind the book’s examples: handwritten digits, oil flow, Old Faithful and synthetic data. Appendix B lists the key properties of widely used distributions such as the Bernoulli, beta, binomial, Dirichlet, gamma, Gaussian, multinomial, Student’s t, von Mises and Wishart. Appendix C collects matrix identities, traces and determinants, matrix derivatives and the eigenvector equation. Appendix D introduces functionals and the calculus of variations, and Appendix E explains Lagrange multipliers, including inequality constraints.
Key Points:
- The digits data is MNIST, with 60,000 training and 10,000 test examples.
- The book quotes error rates on MNIST of 12% for a simple linear classifier, 0.56% for a carefully designed SVM and 0.4% for a convolutional network.
- The oil flow data set is synthetic, from dual-energy gamma densitometry of oil, water and gas in pipelines, with homogeneous, annular and laminar flow configurations.
- Appendix B gives, for each distribution, its expectation, variance or covariance, mode and entropy.
- Appendix C is a reference, not a tutorial, and assumes you already know basic linear algebra.
- The calculus of variations underlies Chapter 10, and Lagrange multipliers (including inequality constraints) underlie the SVM in Chapter 7.
Practice Tip: Download MNIST and fit a plain logistic regression. The book’s 12% error for a simple linear classifier gives you a baseline to compare with.
Important Questions:
- Why does the book use synthetic data so often? With data generated from a known function, such as a noisy sine curve, you can compare any learned model against the true process.
- Where do Lagrange multipliers appear in the book? Appendix E supports the support vector machine derivation in Chapter 7, where constrained optimization leads to the dual problem.
How to Study This Book
The book has 14 chapters and five appendices, and it declares no parts of its own. The printed edition runs to 738 pages with 431 exercises, and every chapter ends with an exercise set graded from quick checks to long derivations. The author says exercises marked www have worked solutions as a PDF on the book website, while solutions to the rest are available only to course tutors through the publisher. This page does not host any of that. Treat the book as a maths-heavy text to read with pencil and paper, not something to skim.
Start with Chapters 1 and 2, even if you know some probability. Chapter 1 sets up the notation, the curve fitting example that runs through the first half of the book, decision theory and information theory, and Chapter 2 gives the distributions (Gaussian, beta, Dirichlet, exponential family) that every later chapter assumes. The preface says the book needs multivariate calculus and basic linear algebra, and that probability is introduced from scratch, but the pace is quick. Keep Appendix B (distributions) and Appendix C (matrix identities) open as references while you read.
For a first machine learning course, a sensible path is Chapter 1, Sections 3.1 and 3.2, Sections 4.1 to 4.3, Sections 5.1 to 5.3, Section 7.1, Sections 9.1 and 9.2, Section 12.1 and Sections 14.2 and 14.3. That gives you regression, classification, a neural network trained by backpropagation, SVMs, clustering with mixtures, PCA and ensembles. You can skip the Hessian material in Section 5.4, the tangent propagation sections in 5.5 and the learning theory in 7.1.5 on a first pass.
For a probabilistic or Bayesian machine learning course, follow a different route: Chapter 2, Sections 3.3 to 3.5, Chapter 8 on graphical models, then Chapter 9 on EM, Chapter 10 on variational inference and Chapter 11 on sampling. Chapter 10 builds on Chapter 9 and uses the calculus of variations in Appendix D, so do not read it earlier. Chapter 13 on hidden Markov models and linear dynamical systems uses the message-passing ideas of Chapter 8 and the EM algorithm of Chapter 9, so read those two first. Chapter 6 on kernels and Gaussian processes pairs with Section 3.3 and with Chapter 7.
The book does not teach deep learning as it is practised today. Chapter 5 uses sigmoidal hidden units and mostly shallow networks, and convolutional networks appear only in Section 5.5.6. There is no ReLU, no modern optimizers, no attention or transformers, and no code at all; the preface mentions a companion volume on practical aspects with Matlab software. Random forests and gradient boosting libraries are not covered by name either, although AdaBoost and decision trees are in Chapter 14. Pair the book with a hands-on course, for example one that uses Python and scikit-learn, and use it for the ideas underneath.
Chapter 12 ties the earlier parts together. Read Section 12.1 on PCA early, because it needs only Chapter 2 and the eigenvector facts in Appendix C. Sections 12.2 and 12.3 are easier after Chapter 9, which gives the EM algorithm, and Chapter 6, which gives kernel substitution, and Bayesian PCA in Section 12.2.3 reuses the relevance idea from Section 7.2. Section 12.4 is a survey of nonlinear alternatives, so treat independent component analysis, autoassociative networks and the topographic mapping as background rather than derivations to memorize. The preface also says the author’s book website offers lecture slides and the figures used in the book, which are useful for revision if that material is still online.
Used In These Programs
This book is used for the Machine Learning and Pattern Recognition courses in: BS Computer Science and in MS programmes in computer science and machine learning. Browse all Machine Learning books or all Computer Science books.
Who Should Read This
This book is written for advanced undergraduates, first-year PhD students, researchers and practitioners, and it assumes no previous knowledge of pattern recognition or machine learning. In practice it suits BSCS students in the later semesters and MS students taking Machine Learning, Pattern Recognition, Probabilistic Models or Bayesian Methods, and it is a widely used reference for research students. The maths level is high, so you should be comfortable with multivariate calculus, linear algebra and probability before starting. If your probability is rusty, Think Stats and Think Bayes give you the intuition in code first, Calculus Volume 3 covers the multivariable calculus the chapters use, and Mathematics for Computer Science helps with proof-style reasoning. It is not a first book for someone new to programming, it is not a deep learning handbook, and it is not an entry-test preparation text.
Applicable Universities
This book is useful for students at Pakistani universities offering BS Computer Science and MS Computer Science with machine learning, pattern recognition or artificial intelligence courses, including Punjab University, Virtual University, COMSATS, FAST, UET, NUST, and other HEC-recognized institutions.
Official Copy of Pattern Recognition and Machine Learning
Microsoft Research offers the full book as a free PDF from its official Pattern Recognition and Machine Learning page. Click below to open the official page and download your copy.
→ Visit Official PageFAQs
Is Pattern Recognition and Machine Learning by Bishop free?
Yes. The official Microsoft Research page says the book is now available to download in full as a PDF. It is not under an open licence: the copyright is held by Springer Science+Business Media, LLC (2006) with the standard all-rights-reserved notice, and Springer also sells the book. Use the official page to download it rather than reposting the file.
Which edition is this?
This is the first edition from 2006, and the preface is dated February 2006. It is the version Microsoft Research offers for download. The book sits in Springer’s Information Science and Statistics series.
How many chapters and exercises does it have, and are there solutions?
There are 14 chapters and five appendices (A to E), and 431 exercises according to the Microsoft Research page. Every chapter ends with an exercise set graded by difficulty. According to the preface, worked solutions to the exercises marked www are available as a PDF on the book website, and solutions to the rest are available to course tutors through the publisher.
Is it good for complete beginners?
Not really. The preface says it assumes no previous knowledge of pattern recognition or machine learning, but it requires multivariate calculus and basic linear algebra, and the pace is fast. If you are new to the subject, start with a gentler introduction and practical work, then use this book as your second, deeper text. Chapters 1 and 2 are the place to begin.
Does it cover SVMs, neural networks, graphical models and EM?
Yes. Chapter 5 covers neural networks and backpropagation, Chapter 6 kernels and Gaussian processes, Chapter 7 support vector machines and relevance vector machines, Chapter 8 graphical models, Chapter 9 K-means and EM, Chapter 10 variational inference, Chapter 11 sampling, and Chapter 14 boosting and decision trees. It does not cover modern deep learning, transformers or large-scale training.
Is it still current in 2026?
The foundations are: Bayesian inference, probabilistic models, kernels, graphical models, EM, variational methods and sampling are still taught from this book. But it is a 2006 text. Its neural network chapter deals with shallow networks using sigmoidal units, and it has no ReLU, deep convolutional or attention-based models, and no code. Read it for the underlying ideas and add a current deep learning resource for practice.
Related Books
- Think Bayes: Bayesian Statistics in Python
- Think Stats: Exploratory Data Analysis in Python
- Mathematics for Computer Science – Lehman, Leighton & Meyer (MIT OCW)
- Calculus Volume 3 – Strang & Herman (OpenStax)
Pattern Recognition and Machine Learning gives you the probabilistic view of the whole field, from curve fitting to graphical models and sampling, in one free book. Browse more Computer Science books for the rest of your semester.
Pattern Recognition and Machine Learning (2006) by Christopher M. Bishop. Copyright © 2006 Springer Science+Business Media, LLC. Microsoft Research hosts a free PDF of the book on its official page. Official source: https://www.microsoft.com/en-us/research/publication/pattern-recognition-machine-learning/. This page links to the official site and does not host or copy the book.
© Copyright Policy
Freebooks.pk is an educational resource for students in Pakistan. Textbooks and other books belong to their respective boards, authors and publishers, and all rights remain with them. If you are the copyright holder of any material on this page and want it changed or removed, please contact us or file a request under our DMCA policy. We review every request and remove reported content promptly.
