Matlab – How to use Linear Discriminant Analysis for projection in MatLab


Is it possible to project a multidimensional data to a 2D map using LDA? It seems that the tool Matlab provided does not provide such functions…

Thanks for reply. My data now is having 6 classes, so does it mean that if I have 6 classes, I can only reduce it to 5 dimensions? Or can it be done in a similar way with PCA, which takes the top 2 eigenvalues, and use these 2 for projection? The PCA does not quite work for my problem as an unsupervised approach, so I am wondering if LDA might help.

Best Solution

LDA isn't really meant for dimensionality-reduction strictly speaking, especially in the cases where all your data belongs to one class. It's meant to come up with a single linear projection that is the most discriminative between between two classes. Thus, there's no real natural way to do this using LDA.

If your data all belongs to the same class, then you might be interested more in PCA (Principcal Component Analysis), which gives you the most important directions for the data ranked in order of importance. Other methods exist as well like ISOMAP (as mentioned by EMS in the comments) or self-organizing maps.

As a side note, LDA can help you reduce dimensionality if you know that you have multi-class data. It can help you reduce dimensionality down to k-1 dimensions if you have k-class data, but you didn't mention that this is the case.

EDIT: Credit goes to @EMS for helping to clarify this answer.

Related Question