-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
LinearDiscriminantAnalysis predict probability bug #6848
Copy link
Copy link
Closed
Description
I am pretty confident there is a bug introduced in commit
7c1101d
Concretely, line 518 of the current version
https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/discriminant_analysis.py
should be removed as it yields wrong results.
There is no reason why constant 1 should be added to the computed probability after exponentiation and before inversion.
To verify this, I have run a one-to-one comparison between the outcome of the method and MATLAB's builtin LDA classifier on the Iris dataset. Only after removal of line 518, results match (up to a tolerance).
If everyone agrees on that, I am happy to submit a PR.
Reactions are currently unavailable