Mixture Models (EM Algorithm)

Context: FIT2086_MOC · W11 · the probabilistic fix for k-means Clustering’s weaknesses · each class carries its own distribution, often a Multivariate Normal Distribution · soft membership is Bayes’ Theorem · chosen by information criterion · fitted by weighted ML · the Pima fit is the joint-modelling classifier from Classification and Conditional Class Probabilities Parent Framework: Machine Learning Styles (Supervised vs Unsupervised)

Quick Revision

  • 🎯 Objective: model the data as weighted sub-populations ➔ soft-assign each item by its posterior ➔ fit by EM for fixed , choose by information criterion.
  • 📦 Core Components: mixing weights ➔ class prevalence | class models ➔ any family per attribute | EM ➔ E-step soft assign, M-step weighted ML | IC / MML ➔ picks .
  • ⚡ Key Constraint: the posterior is weight × likelihood, normalised — ranking classes by alone ignores prevalence, and the unnormalised products give the class but not its probability.

📝 How It Works

1. The Model

  • Mixture density ➔ · classes · mixing (population) weights · parameters of class ‘s joint distribution.
  • Class = cluster ➔ is the fraction of the population in sub-population ; each class has its own distribution per attribute (normal, inverse Gaussian, Poisson, …).
  • Simple form (conditional independence within class) ➔ ⟹ univariate models.
  • Mixed attribute types ➔ each column takes its own family (Pima: predictors Gaussian, diabetes status Bernoulli) — the case k-means handles badly.
  • Related attributes ➔ swap the product for a Multivariate Normal Distribution per class (height and weight correlate within a person).

2. Soft Membership

  • Posterior by Bayes ➔ · = a priori probability of class · = probability of under class .
  • Partial assignment ➔ each item belongs to every class with probability , ; a hard label, if wanted, is the highest posterior.
  • as dissimilarity ➔ equal spherical Gaussians ⟹ comparing ≡ comparing Euclidean distance to centroids (k-means) · general Gaussian ⟹ Mahalanobis-type distance · Bernoulli, Poisson, … ⟹ their own model-appropriate measures.

3. Estimation by EM (fixed )

  1. Initialise ➔ random class memberships or random starting parameters.
  2. E-step ➔ soft-assign every individual: from the current parameters.
  3. M-step ➔ re-estimate every (, ) by weighted ML, item counting with weight toward class .
  4. Repeat until the estimates stabilise.
  • Generalises k-means ➔ k-means is EM with 0/1 weights and spherical equal-variance Gaussians.

4. Choosing

  • Score ➔ information criterion goodness of fit complexity penalty on classes/parameters ➔ smallest wins ➔ Model Selection and Information Criteria (AIC, BIC).
  • MML ➔ minimum message length (C.S. Wallace, Monash): compress the data using the model; the model giving the shortest compressed data wins.
  • Search ➔ non-convex, many local minima ⟹ each iteration: remove classes with too few points · try splitting every class · try combining pairs · randomly reassign and re-estimate ➔ refit with EM, score, keep the lowest, repeat.

5. Lecture Examples

  • 1-D, two normals ➔ and — a bimodal density no single normal fits.
  • 2-D ➔ discovered with — tiny classes survive if they buy enough fit.
  • Galaxy velocities () ➔ : , , , .
  • Pima diabetes ( people, diabetic; 12% of exposure cells missing, INS , SKIN ) ➔ criterion , , , ⟹ .
ClassPREGPLASBMIAGEDIA
  • Reading ➔ high glucose drives both diabetic classes; class 2 is older with more pregnancies, class 1 younger and heavier · class 3 (young, low glucose, low BMI) is the low-risk profile.
  • Slide inconsistency ➔ the summary infographic (slide 49b) prints class 1 as and calls class 2 the highest; the means table gives — table used here, confirm on the forum.

🔬 Model

  • Data ➔ , row = item, column = attribute; no column is nominated as target (DIA in Pima is just another attribute).
  • Parameters ➔ , ; ➔ free weights the per-class model parameters.
  • Objective (fixed ) ➔ maximise the likelihood ⟺ minimise — log of a sum, so no closed form ⟹ EM.
  • Objective over ➔ .

⚖️ Core Decision Matrix

MethodAssignmentSimilarityAttribute typesChoosing Statistical reading
k-means Clusteringhard, one clustersquared Euclidean to centroidcontinuous; mixed types awkwardoutside the method (prior knowledge / trial)none
Mixture modelsoft, , model-basedany family per columninside: IC / MML scoreexplicit: prevalence , class distributions

When It Flips: equal spherical Gaussians with hard 0/1 weights ⟹ the mixture is k-means; elongated or correlated clusters, mixed attribute types, overlapping classes, or a need for "how sure?" ⟹ mixture model.

📊 Exam Execution Trace & Applied Exercises

Manual Execution Trace

Lecture Q2: , , , .

StepClass 1Class 2Note
prior class 2 more common
likelihood data favour class 1
product sum
posterior assign to class 1 — still for class 2

Applied Exercise

Problem: the 1-D lecture mixture (, ). Posterior class probabilities for .

Final Extracted Output: belongs to class 1 with probability — from but from , and class 1 is also more prevalent.

⚠️ Common Mistakes

  • 💡 Dropping ➔ in the trace above, not — prevalence is half the answer.
  • 💡 Reporting only the label ➔ the point of a mixture is the probability; “class 1 ()” earns what “class 1” does not.
  • 💡 Choosing by likelihood ➔ more classes always fit better; only the penalised score can stop at .

🧠 Active Recall