DATA ANALYTICS-IL3253
Fishers Linear Discriminant
Department of Industrial Engineering
Anna university CEG Campus,chennai
ByDK Shree charan ranjan
Vikram P
Kaushik D
ME QUALITY ENGINEERING AND
MANAGEMENT
1ST YEAR/2ND SEM
1
Introduction
• Fishers Linear Discriminant (FLD), is a statistical dimensionality reduction principal which is widely popular
for Machine Learning as well as Pattern Recognition techniques.
• This principal is incorporated by the techniques like – Linear Discriminant Analysis (LDA), Normal
Discriminant Analysis (NDA) and many more.
• FLD work better than PCA as it –
• Maximizes the distance between different classes.
• Minimizes the distance within the class.
• It preserves the projection line direction which is very useful for separating different classes.
Goal: To project the dataset with feature set (N) into feature set (M), where [ M <= (N-1) ]
2
Example Problem
Consider the data of 2 classes asClass 1 has 5 Samples (C1): [(4,1),(2,4),(2,3),(3,6),(4,4)]
Class 2 has 5 Samples (C2): [(9,10),(6,8),(9,5),(8,7),(10,8)]
Step 1: Compute the Mean (u) of each classui = (x1 + x2 +….. + xn)/n
Therefore,
u1 = [3 , 3.6]
u2 = [8.4 , 7.6]
Step 2: Compute within-class Scatter matrix (Sw)
Sw= S1+S2
S. No.
X
Y
Class
1
4
1
C1
2
2
4
C1
3
2
3
C1
4
3
6
C1
5
4
4
C1
6
9
10
C2
7
6
8
C2
8
9
5
C2
9
8
7
C2
10
10
8
C2
Table 1. Sample Dataset
where S1 and S2 are the covariance matrix of class C1 and C2 respectively.
1
S1 = ℕ σ𝒏𝒊=𝟏 𝒙𝒊 − 𝒖𝟏 𝒙𝒊 − 𝒖𝟏 𝑻
and similarly for S2 as well.
3
Cntd…
T
S1 = (1/5)*
𝛴
1
-2.6
-1
0.4
-1
-0.6
0
2.4
1
*
0.4
(xi - ui)T
(xi - ui)
Going One by one will leads us to1.
1
-2.6
1
−2.6
* [1 -2.6] = −2.6 6.76
4.
0
2.4
* [0 2.4] =
0
0
0 5.76
Adding Equation 1, 2, 3,4, 5 well get
2.
-1
0.4
* [-1 0.4] =
1
−0.4
−0.4 0.16
5.
1
0.4
* [1 -0.4] =
1
0.4
-1
1
*
[-1
-0.6]
=
-0.6
0.6
0.6
0.36
4
−2
𝟎. 𝟖
and then dividing each element by (1/5) will lead to S1=
−2 13.2
−𝟎. 𝟒
− 𝟎. 𝟒
𝟐. 𝟔
3.
0.4
0.16
4
So,
𝟏
𝟒
−𝟖
−𝟐
𝟏𝟑. 𝟐
𝟎. 𝟖
−𝟎. 𝟒
− 𝟎. 𝟒
𝟐. 𝟔
S1 = 𝟓 ∗
Therefore,
S1 =
Similarly,
S2= [𝟏. 𝟖𝟏 − 𝟎. 𝟎𝟒
-0.04 2.64]
Therefore,
Sw = [2.64 -0.44
-0.44 5.28]
5
Cntd…
Step 3: Now we need to compute between class Scatter matrix (SB).
SB = (u1 – u2) * (u1 – u2)T
SB= [(- 5.4, -4) * (- 5.4, -4)T]
SB= [29.16 21.6
21.6 16.0]
Step 4: Finding the best Projection Vector using Sw and Mean.
𝑣1
= Sw -1 *(u1 – u2)
𝑣2
𝑎
𝑐
1
𝑏
𝑑
-1 = 𝑎𝑑−𝑏𝑐
𝑑
−𝑐
Sw -1 =
𝟎. 𝟑𝟖𝟒 𝟎. 𝟎𝟑𝟐
𝟎. 𝟎𝟑𝟐 𝟎. 𝟏𝟗𝟐
Sw -1 =
−𝑏
𝑎
6
Cntd…
Therefore our optimal Line of Direction V (optimal projection) is –
V = Sw -1 * (- 5.4, -4)
V=
𝟎. 𝟑𝟖𝟒 𝟎. 𝟎𝟑𝟐
* (- 5.4, -4)
𝟎. 𝟎𝟑𝟐 𝟎. 𝟏𝟗𝟐
V=
−𝟐. 𝟐𝟎
−𝟎. 𝟗𝟒
Step 5: Finally, we can calculate actual 1D data with the help of –
y1 = VT * C1T
y2 = VT * C2T
7
Cntd…
We know, (C1): [(4,1),(2,4),(2,3),(3,6),(4,4)]
& (C2): [(9,10),(6,8),(9,5),(8,7),(10,8)]
Also, V=
−𝟐. 𝟐𝟎
−𝟎. 𝟗𝟒
-7.22
-12.24
Therefore Y1 and Y2 are-
Y1= [-2.20 -0.94] *
4 2
1 4
2 3 4
= [-9.74
3 6 4
Y2= [-2.20 -0.94] *
9
10
6 9 8 10
= [-29.2
8 5 7 8
Finally, the optimal line of Projection is V=
-8.6
-20.72
-24.5
-12.56]
-24.18
-29.52]
−𝟐. 𝟐𝟎
and 1D data of Class 1 and 2 are shown above.
−𝟎. 𝟗𝟒
8
Advantages of FLD
• Minimizes the variance and maximize the class distance between two variables.
• Works better for multi class problem too.
• Can be use for classification task too.
9
Disadvantages of FLD
• When the discriminative information are not in the means of classes.
• Small sample size problem.
• Not suitable for non linear models
• Works with Labelled Data only (Supervised in nature).
10
References
[1] Silva, T. S. (2019, January 3). An illustrative introduction to Fisher’s Linear Discriminant. Thalles’ Blog.
https://sthalles.github.io/fisher-linear-discriminant/
[2] Wikipedia contributors. (2021, October 13). Linear discriminant analysis. Wikipedia.
https://en.wikipedia.org/wiki/Linear_discriminant_analysis
[3] Bishop. (2006). Pattern Recognition and Machine Learning | Christopher M. Bishop | Springer. Pattern
Recognition. Retrieved 2021, from https://www.springer.com/gp/book/9780387310732
[4] https://www.csd.uwo.ca/~oveksler/Courses/CS434a_541a/Lecture8.pdf
11
Thank You
16-04-2026
12