Skip to content

LinearDiscriminantAnalysis predict probability bug #6848

@agamemnonc

Description

@agamemnonc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions