3

In duration of reading about LinearDiscriminantAnalysis using python , I had got two different methods to implement it which are available here , http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html#sklearn.discriminant_analysis.LinearDiscriminantAnalysis

In these method the signature is here ,

sklearn.discriminant_analysis.LinearDiscriminantAnalysis(solver=’svd’, shrinkage=None, priors=None, n_components=None, store_covariance=False, tol=0.0001)

Now again i found one more method with same kind of signature , which is available here ,

http://scikit-learn.org/0.16/modules/generated/sklearn.lda.LDA.html

sklearn.lda.LDA(solver='svd', shrinkage=None, priors=None, n_components=None, store_covariance=False, tol=0.0001)

I just wanted to know that what is difference between both . which method we should use in projects and why ?

Shubham Sharma
  • 2,763
  • 5
  • 31
  • 46

2 Answers2

1

They seem to be exactly the same (I assume LDA is short for LinearDiscriminantAnalysis) as shown by the docs:

http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html

and

http://scikit-learn.org/0.16/modules/generated/sklearn.lda.LDA.html

As these pages are identical, even up to the sample code, except for the fact that all references of sklearn.lda.LDA have been replaced by sklearn.discriminant_analysis.LinearDiscriminantAnalysis, I don't think it matters which one you use at all.

I hope this answers your question, they're the same!

Atto Allas
  • 610
  • 5
  • 16
1

According to documentation they are available here and as mentioned by @Atto

http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html

and

http://scikit-learn.org/0.16/modules/generated/sklearn.lda.LDA.html

Now basically LDA is basically an older version and LinearDiscriminateAnalys is newly updated and is preferred