About the algebra used in linear discriminant analysis in scikit learn (LDA using SVD)

166 Views Asked by At

I've looked for info about how LDA is impemented in scikit-learn but there's no clue about what I'm looking for. In this code in python:

https://github.com/scikit-learn/scikit-learn/blob/a95203b/sklearn/lda.py#L127

I don't understand what's happening with _solve_svd. I mean, from the line 362 to 390, how and why is used the SVD descomposition? I know that the inverse of the covariance matrix can be expressed using that descomposition (something like VD^-2 Vt) but that's not what is implemented.

So, in short:

Could you explain something about that relation between LDA and SVD? Is there something more than the inverse of the covariance matrix?

I'm sorry if the question is stupid but there's no step-by-step explanation anywhere.

Thank you very much!