Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Consistency in GMM, _get_covars #1528

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

Closed
amueller opened this issue Jan 6, 2013 · 5 comments
Closed

Consistency in GMM, _get_covars #1528

amueller opened this issue Jan 6, 2013 · 5 comments
Milestone

Comments

@amueller
Copy link
Member

amueller commented Jan 6, 2013

There are some consistency issues in the mixtures module.
The covariance matrices in VBGMM and DPGMM are called precision and covars in GMM for example.
There is also a _get_covars function in GMM, that actually seems pretty helpful: it provides the full covariance matrices independent of the covariance type. But I find the docstring misleading and it is privat, so it is not visible in the online docs and to autocompletion.

@jaquesgrobler
Copy link
Member

Hey Andy - happy new years!
So should VBGMM and DPGMM's precisions_ attribute be changed to covars_ like in gmm.py?
Also, the docstrings read:

`precisions_` : array
        Precision (inverse covariance) parameters for each mixture
        component.  The shape depends on `covariance_type`

and

`covars_` : array
        Covariance parameters for each mixture component.  The shape
        depends on `covariance_type`

So different

and the _get_covars function needs a better docstring and made public?

@amueller
Copy link
Member Author

amueller commented Jan 7, 2013

Hey Jaques. Happy new year to you, too!

hum. Ok so they are differnent and shouldn't be renamed. But why are they stored one way in one estimator and the other way in the other estimators?

But yeah, I'd be very much in favor of making the function public and adding a proper docstring. And see how that fits into the general interface.

@jaquesgrobler
Copy link
Member

hum. Ok so they are differnent and shouldn't be renamed. But why are they stored one way in one estimator and the >other way in the other estimators?

That I'm not sure of.. Perhaps it works better for dpgmm to use it like that, as opposed to the gmm way.. I'd have to read into it further.. just a guess for now :)

@kastnerkyle
Copy link
Member

Some formulations of GMMs like to use precision instead of covariance, or at least my teacher (who used Bishop) tended to formulate things with precision instead of covariance, including GMM.

Would a stopgap fix for this be to have both covars_ and precision_ available for each? Or maybe add a _get_precision() function to both (and a _get_covars() to the ones which need it), but keep them private for now - I can see situations where one or the other might be more useful/more stable

@amueller
Copy link
Member Author

gmm is deprecated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants