Incomplete 1
Incomplete 1
Assumptions of LDA
1. The input dataset has a Gaussian distribution.
For checking whether the given data is Gaussian, perform the Shapiro-Wilk Test.
2. Each class has the same covariance matrix. For checking covariance, either evaluate
the covariance matrix of all features or check using Box’s M Test of equality of
covariance matrices.
3. The Classes are linearly separable in the projected space — not necessarily in the
original space
.
Intuition Behind LDA
The core idea behind Linear Discriminant Analysis (LDA) is to find the best projection that
maximizes the separation between different classes while minimizing the spread within each
class.
ai = vTxi
Step 2: Calculate mean and variance of projected class
• Let μi be the mean of class i after its projection.
• Let si be the standard deviation about its mean of class i after its projection.
Variance is:
Step 3: Calculate the inter class distance and within class variance
• Inter class distance: maxv (µ1 - µ2)2
• Within class variance: minv (s12 + s22)
•
• The total within-class scatter of the two classes in the projection space is
vT Sb v
• Equation 1 becomes: maxv
vT Sw v
This result is valid for more than 2 classes also. Here’s the proof:
Step 4: Rayleigh Quotient Corollary 0.5 gives a direct simplification of
such forms to the eigenvalue equation:
Sbv = λSwv
To solve this, we transform it into a regular eigenvalue problem:
Sw-1Sbv = λv
Now this is a simple eigen value problem which can be used to easily find all the
eigen values.
For f features and c label classes, we will get f eigen values. However, we choose
only min[f,c-1] eigen values chosen in descending order, all other values are
discarded.
In essence, it is generally seen that the first two eigen values carry the most
importance seen by its
explained ratio: