The main reference is the article
Http://www.cnblogs.com/LeftNotEasy/archive/2011/01/08/lda-and-pca-machine-learning.html
Http://www.cnblogs.com/jerrylead/archive/2011/04/21/2024384.html
Http://www.cnblogs.com/jerrylead/archive/2011/04/21/2024389.html
The above three blogs have been summed up very well:
Here we summarize the most important part:
the principle of LDA is that The data that will be tagged (points) , projection to the lower dimension of the space by projection, so that the projected points, will form a classification by category, a cluster of clusters of cases, the same category of points, will be in the projected space closer. To understand LDA, you first have to understand the linear classifier (Linear Classifier): Because LDA is a linear classifier. For a classification problem of K-classification, there will be K linear functions:
When the condition is met: For all J, there are YK > Yj, when we say x belongs to category K. For each classification, there is a formula to calculate a score, in all the formula to get the score, find one of the largest, is the classification of belong.
The above is actually a kind of projection, is a high-dimensional point projection to a high-dimensional line, LDA most of the goal is to give a labeled category of the data set, projected into a line, can make the point as far as possible by the category, when the k=2 is two classification problem, as shown in:
When x is two-dimensional, we're looking for a straight line (W) to do the projection, and then we'll look for the line that best separates the sample points. Such as:
From the intuitive point of view, the right image is better, can be very good to separate different categories of sample points.
The calculation process is no longer explained: mainly to meet a principle:
we are The goal of the classification is to make the point distance within the category as close as possible (centralized), and the point farther away from the category is better.
The constraints of the Lagrange multiplier method are brought in:W is the corresponding low-dimensional projection matrix, SB represents the distance between the center points of the original data category, and SW represents the sum of the distance of the data points and their central points in each category .
Such a formula is a question of finding eigenvalues.
For the problem of N (N>2) classification, I directly wrote the following conclusion: for the multi-class situation SW does not change, SB because the multi-category, is to use all the data to calculate a central point calculates the distance squared and obtains
There are many methods of calculating PCA, using the method of maximizing variance and minimizing loss method, which is based on eigenvalue solution, and LDA is similar
If the eigenvalue decomposition is used, then it is similar to the SVD
Compare the PCA and LDA:
PCA and LDA, both thought and computational methods are very similar, but one is as independent algorithm exists, another more for the data preprocessing work.
Examples of LDA:
Comparison of the dimensionality reduction between PCA and LDA:
The PCA selects the sample point projection with the direction of the maximum variance, and LDA chooses the best way to classify the performance.
Since LDA is called linear discriminant analysis, it should have some predictive functions, such as a new sample x, how to determine its category?
With a value of two, we can project it to a straight line, get Y, and see if Y is y0 over a certain threshold, more than a certain class, or another class. And how do you find this y0?
See
According to the central limit theorem, the stochastic variable with independent distribution and the Gaussian distribution are conformed, then the maximum likelihood estimation is used to find
Then use the formula in the decision theory to find the best y0, see PRML for details.
This is a feasible but cumbersome selection method, you can see the 7th section (some questions) to get a simple answer.
5. Some limitations of using LDA
1. LDA can generate up to C-1 subspace space (this should be because the premise of calculating the characteristic variable in a multi-category is SB reversible, so the rank has certain requirements)
The dimension interval of LDA descending dimension is in [1,c-1], independent of the original characteristic number n, and for the binary classification, it is projected up to 1 dimensions.
2. LDA is not suitable for dimensionality reduction of non-Gaussian distribution samples.
The middle red area represents a class of samples, and the blue area represents another class, and because it is a class 2, it is projected up to 1 dimensions. No matter how it is projected on a straight line, it is difficult to condense the red dots and the blue dots, separating the classes from each other.
3. LDA does not work well when the sample classification information relies on the variance instead of the mean value.
, the sample points are categorized by variance information rather than mean information. LDA is not able to classify effectively because LDA relies heavily on mean information.
4. LDA may over-fit data.
A summary of LDA algorithm