Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

richy1996
Copy link
Contributor

Reference Issues/PRs

None

What does this implement/fix? Explain your changes.

Any other comments?

I haven't fully implemented the methods for the other classes, e.g. GMMHMM etc. but it's in the works.

@blckmaxima
Copy link
Contributor

Thank you!

  • Adding an example of aic/bic being used for model selection would be great.
  • Incorporate these methods into the existing test suites.

@anntzer
Copy link
Contributor

anntzer commented Jul 11, 2022

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?

@richy1996
Copy link
Contributor Author

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):
Copy link
Contributor

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 ?

Copy link
Contributor Author

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?

Copy link
Contributor

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.

@blckmaxima
Copy link
Contributor

We've added aic() and bic() in a separate MR: #500

@blckmaxima blckmaxima closed this Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants