Lecture 11b
Overview
The lecture reviews K-means and document clustering, then introduces Gaussian mixture models (GMMs) as probabilistic models for clustered data. It derives soft and hard cluster assignments from Bayes’ rule and explains why fitting GMM parameters with maximum likelihood requires expectation-maximization (EM): EM alternates between tightening a lower bound using hidden-variable probabilities and maximizing that bound over model parameters.
Key takeaways
- A GMM models clustered data as a weighted sum of K Gaussian densities, with each component having its own mean and covariance and each weight representing its sampling probability.
- GMM soft assignments are posterior probabilities: each component’s Gaussian density at x is multiplied by its mixture weight and normalized across all components.
- GMM maximum-likelihood fitting is difficult because the log likelihood contains a log of a sum of Gaussian densities and is non-convex.
- EM treats component membership as a hidden variable, estimates its posterior distribution in the E-step, and maximizes the expected complete-data log likelihood in the M-step.
- EM can be understood as a majorization-minimization method: it tightens a likelihood lower bound using the current posterior, then optimizes that bound over model parameters.
- TF-IDF features form sparse term-document matrices, and NMF can yield interpretable nonnegative document topics; in the lecture’s four-news-group example, it separated graphics and science topics and divided religious from philosophical material.
Chapters
- K-means minimizes a residual sum of squares by assigning samples to their nearest centroid; each centroid’s region is a Voronoi cell.
- Exact K-means optimization is computationally hard, so Lloyd’s algorithm alternates between assigning samples and recomputing cluster means; random restarts can reduce poor local minima.
- The bag-of-words model represents documents with term counts, while term frequency-inverse document frequency (TF-IDF) adjusts those features and produces a sparse term-document matrix.
- On four news groups, nonnegative matrix factorization (NMF) produced interpretable topics, including graphics, science and space, religious writing, and philosophical writing.
- A multivariate Gaussian is specified by a mean vector and covariance matrix, which determine the center and spread of its probability density.
- In two dimensions, Gaussian density contours are ellipses; covariance eigenvectors give their orientations and square roots of eigenvalues give their relative stretches.
- A GMM sums K Gaussian probability density functions, each with its own mean and covariance matrix.
- The mixture weights γₖ must be nonnegative and sum to one; they represent the probability of drawing a sample from each component.
- A mixture of Gaussian densities is not the same as summing Gaussian random samples, which would produce a Gaussian under the conditions discussed.
- To sample from a GMM, first draw a discrete component index κ from the probability mass function formed by the mixture weights.
- Then draw x from the Gaussian specified by the selected component’s mean and covariance.
- The component index κ is a hidden variable: it provides a hierarchical interpretation of the mixture even though it does not appear explicitly in the marginal density p(x).
- For a sample x, the posterior probability of component k is proportional to γₖ times that component’s Gaussian density at x.
- Normalizing across all K components gives a soft assignment, a probability distribution over possible cluster labels.
- A hard assignment selects the component with the largest posterior probability, allowing GMMs to cluster training samples or new observations.
- Maximum likelihood estimates the GMM parameters θ, including component means, covariance matrices, and weights, by maximizing the data likelihood.
- The log likelihood contains a logarithm of a sum of Gaussian densities, which does not simplify into the quadratic form available for a single Gaussian.
- Because the resulting objective is non-convex, direct optimization can become trapped at an undesirable local optimum.
- Expectation-maximization (EM) is an iterative approximation for maximum-likelihood problems with hidden variables.
- In the E-step, compute a Q function using the current parameter estimate; in the M-step, maximize Q over θ to obtain the next estimate.
- The lecture contrasts EM with gradient ascent on a non-convex likelihood and notes that initialization still matters because EM can converge to a local maximum.
- Q is the expectation of the complete-data log joint probability, log p(X, Z | θ), under a distribution over hidden variables Z.
- The expectation uses the posterior distribution of Z given the observed data X and the previous parameter estimate θᵗ.
- If the hidden-variable distribution were certain, the expectation would reduce to evaluating the log joint at one value; in practice it averages across plausible values.
- Introducing any valid probability distribution over hidden variables lets the log likelihood be rewritten as a sum of terms involving entropy, a KL divergence, and an expected log joint.
- The KL divergence is nonnegative, so removing it yields a lower bound on the log likelihood.
- The bound depends on the chosen hidden-variable distribution: it is tight when that distribution matches the relevant posterior and looser when they differ.
- Majorization-minimization (MM) alternates between constructing a bound that touches the objective at the current estimate and optimizing that bound.
- The lecture’s one-dimensional triangular likelihood example shows why gradient ascent can bounce around a nondifferentiable peak instead of converging.
- A sequence of tight quadratic lower bounds can move toward the peak through easy maximizations, illustrating the broader MM strategy.
- The E-step chooses the hidden-variable distribution to match the posterior under the current parameters, making the likelihood lower bound as tight as possible at that iteration.
- The M-step maximizes the expected log joint with respect to θ; terms independent of θ do not affect this optimization.
- This identifies EM as a particular MM procedure, while the next lecture is set to derive the specific E- and M-step formulas for fitting GMMs.
Transcript excerpt
0:02 Okay, hope you guys had a good Thanksgiving break. Um, so we're getting near the end of the course here. Just a few more things to discuss. Uh, and just as a prelude to today's lecture, let's kind of review where we were. So last time we talked about the problem of clustering. [clears throat] The idea there is you're given a data set of feature vectors and you want to partition that data set into K groups. We'll assume that K is fixed and known where the samples are similar within a group and dissimilar across groups. Um, [clears throat] and there's different ways to describe that similarity. The standard way is to use uklidian distance. So for example, this picture
0:51 shows um [clears throat] that you you know you have you're given these two dimensional samples and this algorithm whatever algorithm it was uh decided that all these red ones form one cluster that all these green ones form another and so on. Then similarly over here we have an algorithm that decided that these form one cluster and these red ones form another. And [snorts] this particular algorithm had this other feature that um for certain samples that it wasn't sure about it. It it clustered them into like a third category that it called noise. [clears throat] Okay. So that's clustering and we saw basically um two or three different approaches uh last time. First we talked about K means clustering. So in K
1:38 [clears throat] means clustering you define this RSS based cost which is a sum over your data samples of um the distance from each sample in your data set to the cluster that is closest to that sample. [clears throat] And so here you're trying to optimize these cluster locations and um [clears throat]
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Prof. Schniter.