LDA 的 MATLAB 实现。
# Experiment 3: Linear Discriminant Analysis
This is a report on Experiment 3: Linear Discriminant Analysis.
# Purpose
In this experiment, we want to reduce the dimension of some datasets with a supervised method, the LDA algorithm.
Two datasets are given; the first has two categories, and the second one has three categories.
# Hypothesis
We assume that the pre-marking is correct.
# Procedure
For the dataset with two categories, I first calculated the between-class scatter and the within-class scatter.
The cost function is defined as
in which is a Lagrange multiplier. Without loss of generality, we set . Then we know that is the eigenvector of corresponding to the maximum of eigenvalue.
After that, we draw the points projected onto the line .
For the dataset with three categories, the calculation is the same.
# Results
The diagram of the dataset with two categories is as follows:
The diagram of the dataset with three categories is as follows: