New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation error in GaussianMixture #10141
Comments
My matrix algebra seem very rusty :-/
all produce the same result, which makes me think there's just some transpose somewhere? |
Ah, never mind. IC is not a cholesky because it's upper triangular times lower triangular. So yes, seems like an issue with the docs. |
Please feel free to offer a PR with a change in the docs. |
Hi In |
@FarahSaeed friendly advice: for clarity's sake link to code like this. In your particular example, I guess you mean scikit-learn/sklearn/mixture/gaussian_mixture.py Lines 644 to 647 in e260119
|
@lesteve yeah exactly. |
Yeah that definitely looks like an inconsistency in the code. Maybe it would make more sense to take the Cholesky than the precision for the initialization. Is there a good way to fix this without creating backwards compatibility issues? |
@jnothman As far as my understanding, we generally use cholesky decomposition for calculating inverse of positive definite matrix efficiently(better than LU decomposition), so taking cholesky of covariance makes sense in order to calculate precision matrix eventually. So, It might be just an documentation error. If so, can I move ahead to make changes in documentation? Thanks |
This isn't my expertise, @aby0, but submit a PR and the change will certainly be considered! |
In the documentation of sklearn.mixture.GaussianMixture, it says that precisions_cholesky_ is:
"The cholesky decomposition of the precision matrices of each mixture component."
However in lines 317--321 of sklearn.mixture.gaussian_mixture.py it is clearly computing the inverse of the cholesky rather than the cholesky of the inverse. These are not the same:
gives
I think the code is correct, but the documentation needs to be corrected. The same issue applies to BayesianGaussianMixture.
The text was updated successfully, but these errors were encountered: