Model each class by a Gaussian p(x | Ck) = N(x | μk, Σk) and a prior p(Ck); Bayes' theorem gives the posterior as a softmax of ak = ln p(x | Ck)p(Ck). If the classes share one covariance, the quadratic terms cancel, ak = wkTx + wk0 is linear and every boundary is a straight line; changing a prior only shifts the lines in parallel. If the covariances differ, the boundaries are quadratic curves. Fitting by maximum likelihood uses class fractions, class means and (for a shared covariance) the pooled covariance.
code/ch05_single_layer_classification.py (functions generative_fit, gaussian_posteriors, two_class_lda, lda_weights; Figures 5.13, 5.14).