Linear discriminant analysis (LDA) is an algorithm that looks for a linear combination of features in order to distinguish between classes. It can be used for classification or dimensionality reduction by projecting to a lower dimensional subspace. LDA requires a target attribute both for classification and dimensionality reduction.
If we represent class densities as multivariate Gaussians, then LDA assumes that the classes have the same covariance matrix. We can use training data to estimate the parameters of the class distributions.
In scikit-learn, lda.LDA
has been deprecated in 0.17 and renamed discriminant_analysis.LinearDiscriminantAnalysis
. The default solver of this class uses singular value decomposition, does not need to calculate the covariance matrix, and is therefore fast.