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
Add Method to get n_params and AIC/BIC for GaussianHMM #482
Conversation
Thank you!
|
This seems related to _get_n_fit_scalars_per_param, and should perhaps also depend on what exactly gets fitted between startprob, transmat, and the emission model? |
Yes it is related to that it seems. Sorry but can you elaborate on the part regarding what gets fitted? |
@@ -309,6 +309,50 @@ def _do_mstep(self, stats): | |||
self._covars_ = ((covars_prior + c_n) / | |||
(cvweight + stats['post'][:, None, None])) | |||
|
|||
def _n_parameters(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reuse some of https://github.com/hmmlearn/hmmlearn/blob/main/lib/hmmlearn/hmm.py#L184 (_get_n_fit_scalars_per_param
) here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it seems so, would you like me to incorporate _get_n_fit_scalars_per_param into aic/bic and scrap _n_parameters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that makes sense, and is inline with what I think @anntzer was thinking too.
We've added |
Reference Issues/PRs
None
What does this implement/fix? Explain your changes.
_n_parameters
,bic
, andaic
to theGaussianHMM
class.Any other comments?
I haven't fully implemented the methods for the other classes, e.g. GMMHMM etc. but it's in the works.