Derive why the directions that maximise the multi-class Fisher criterion are the leading eigenvectors of SW−1SB. Start with a single direction w and maximise w⊤SBww⊤SWw. How do you show that for two classes the result reduces to w∝SW−1(m1−m0)?

Supervised learning, Fisher discriminant analysis
Level L4 Advanced. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can use a Lagrangian (or Rayleigh quotient) argument to get a generalised eigenproblem and read off its meaning.

Key idea

Maximising w⊤SBw subject to w⊤SWw=1 gives SBw=λSWw, and the maximum value is the largest λ.

Steps

  1. The ratio J(w)=w⊤SBww⊤SWw is unchanged if w is rescaled. So fix the scale with the constraint w⊤SWw=1 and maximise w⊤SBw.
  2. Lagrangian: L=w⊤SBw−λ(w⊤SWw−1). Setting ∇wL=2SBw−2λSWw=0 gives SBw=λSWw.
  3. If SW is invertible, this is the ordinary eigenproblem SW−1SBw=λw.
  4. Multiply by w⊤: w⊤SBw=λw⊤SWw=λ. So the value of the criterion at a stationary point is the eigenvalue itself, and the maximum is the largest eigenvalue.
  5. For several directions W=[w1,…,wm] we maximise tr ⁣[(W⊤SWW)−1(W⊤SBW)]. Using the same argument, the optimum is the matrix of eigenvectors with the m largest eigenvalues. There are at most C−1 nonzero eigenvalues because rank SB≤C−1.
  6. Two classes: SB=n0n1ndd⊤ with d=m1−m0, which is rank one. Then SBw=n0n1n(d⊤w) d, and the equation SBw=λSWw gives SWw∝d, so w∝SW−1d. The only nonzero eigenvalue is λ=n0n1nd⊤SW−1d.
  7. Note that SW−1SB is not symmetric. In practice solve the symmetric generalised problem, for example by whitening with SW−1/2 first, so the eigenvectors are orthogonal in the whitened space and the eigenvalues are real.

Common mistakes

How long your answer should be

One page; 10 minutes.

Last checked on 4 December 2026.

Read this

Previous in Supervised learning: Two classes have densities N(μ0,Σ) and N(μ1,Σ) with equal priors. Show that the Bayes error is Φ(−Δ/2), where Δ2=(μ1−μ0)⊤Σ−1(μ1−μ0) and Φ is the standard normal cdf. What is its value for μ0=(0,0), μ1=(2,2), Σ=(10.50.51), and how does it compare with the Bhattacharyya bound?
Next in Supervised learning: Prove that the leave-one-out residual of ordinary least squares is ei/(1−hii), where ei is the ordinary residual and hii the leverage, so LOOCV needs only one fit. How do you check it on the points (0,1),(1,3),(2,3) by computing the LOOCV mean squared error both ways?