在之前的博文介绍了,LDA以及PCA的原理以及算法过程,下面说说他们的区别:
The widely-used principal component analysis (PCA) and linear discriminant analysis (LDA) are two representative feature projection techniques
– the former is for unsupervised learning and the latter for
classification. PCA is an orthonormal transformation of data to a low-dimensional space such that
maximum variance of the original data is preserved. latent semantic indexing (LSI) , essentially just a different name for PCA when applied to analyzing text data, has been used to map text documents to a low-dimensional “topic” space spanned by some underlying
latent concept vectors. PCA works well for
a lot of data analysis problems but does not fit well for classification purposes. LDA and other supervised feature selection techniques are better positioned for classification in that they reduce the input features in such a way that maximum separability
between target classes is preserved.
下面我们来看一些例子:
例1:
图的左边是PCA,它所作的只是将整组数据整体映射到最方便表示这组数据的坐标轴上,映射时没有利用任何数据内部的分类信息。因此,虽然做了PCA后,整组数据在表示上更加方便(降低了维数并将信息损失降到最低),但在分类上也许会变得更加困难;图的右边是LDA,可以明显看出,在增加了分类信息之后,两组输入映射到了另外一个坐标轴上,有了这样一个映射,两组数据之间的就变得更易区分了(在低维上就可以区分,减少了很大的运算量)。
PCA 是无监督的,它所作的只是将整组数据整体映射到最方便表示这组数据的坐标轴上,映射时没有利用任何数据内部的分类信息用主要的特征代替其他相关的非主要的特征,所有特征之间的相关度越高越好。
但是分类任务的特征可能是相互独立的,LDA是有监督的,使得类别内的点距离越近越好(集中),类别间的点越远越好。
图1: PCA与LDA的主元方向(无差异)
有两类数据class1和class2,PCA-1和PCA-2分别指通过PCA找到的第1个主元方向和第2个主元方向,LDA-1是指通过LDA找到的第1个主元方向(由于本例中只含有2类数据,因此LDA最多只能找到1个主元方向)。从图1中可以看出LDA的第一个主元方向可能与PCA的第二个主元方向相同(但方向相反)。
当然有些时候也会有所差别,如图2:
图2:PCA和LDA的主元方向(有差异)
图中LDA的第一个主元方向和PCA的第二个主元方向近似,但是分离效果应该优于PCA的第二个主元方向。
结论:PCA中或许包含有与LDA方向相似甚至相同的方向,但是这并是发生在任何情况下。因此如果PCA和LDA用于分类问题,LDA的方向理论上要更胜一筹。原文:http://blog.csdn.net/jojozhangju/article/details/19652453