Class 0 has points (1,2),(2,1),(3,3) and class 1 has points (5,4),(6,6),(7,5). With equal priors, fit LDA (shared covariance). What are the discriminant direction w and the boundary, and which class is the query (4,3) assigned to?

Supervised learning, Linear discriminant analysis
Level L3 Intermediate. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can estimate class means and the pooled covariance, then apply w=Σ−1(μ1−μ0) and the midpoint threshold.

Key idea

LDA assumes x∣y=k∼N(μk,Σ) with one shared Σ, so the boundary is linear: w⊤x=w⊤μ0+μ12 with w=Σ−1(μ1−μ0) (for equal priors).

Steps

  1. Class means: μ0=(2,2) and μ1=(6,5). Difference μ1−μ0=(4,3).
  2. Deviations from the mean. Class 0: (−1,0),(0,−1),(1,1). Class 1: (−1,−1),(0,1),(1,0).
  3. Scatter of each class ∑dd⊤: both equal (2112). Total within-class scatter is (4224).
  4. Pooled covariance Σ=1n−2× scatter =14(4224)=(10.50.51). Its inverse is 10.75(1−0.5−0.51)=(4/3−2/3−2/34/3).
  5. w=Σ−1(4,3)⊤=(163−2, −83+4)=(103,43), which is proportional to (5,2).
  6. Threshold: the midpoint is (4,3.5), and w⊤(4,3.5)=403+143=18. So the boundary is 103x1+43x2=18, that is 10x1+4x2=54.
  7. Query (4,3): 10×4+4×3=52<54, so it falls on the class 0 side. Class 0 is predicted. (Check with (5,3): 62>54, class 1.)

Common mistakes

How long your answer should be

One page; 7–8 minutes.

Last checked on 4 December 2026.

Read this

Previous in Supervised learning: What is the AdaBoost algorithm for binary labels yi∈{−1,+1}, and when and why must a weak classifier be rejected, in terms of its weight αt?
Next in Supervised learning: For two classes, Fisher's criterion is J(w)=(w⊤(m1−m0))2w⊤SWw, where m0,m1 are the class means and SW is the total within-class scatter matrix. Show that the maximiser is w∝SW−1(m1−m0). How do you check it for m1−m0=(3,2) and SW=diag(2,1)?