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

Allow model built earlier to be used to calculate full loglikelihood and AIC for GLM #15809

Closed
wendycwong opened this issue Oct 9, 2023 · 0 comments · Fixed by #16025
Closed
Assignees
Labels
Milestone

Comments

@wendycwong
Copy link
Contributor

here is the support ticket: https://support.h2o.ai/a/tickets/106503

Basically, a customer would like to be able to calculate the full AIC and log likelihood function after a model has been built earlier perhaps using an earlier version of H2O-3.

Here is a proposal:

  1. Build a model with compute_p_values=True;
  2. Save the model to mojo (make sure dispersion parameter is saved to mojo and is available);
  3. Load the model back using generic_model and just call whatever function there is to calculate the full AIC and compute the full log likelihood.
@krasinski krasinski added this to the 3.46.0.1 milestone Oct 17, 2023
syzonyuliia pushed a commit that referenced this issue Jan 22, 2024
syzonyuliia pushed a commit that referenced this issue Jan 22, 2024
syzonyuliia pushed a commit that referenced this issue Jan 26, 2024
syzonyuliia pushed a commit that referenced this issue Jan 26, 2024
syzonyuliia pushed a commit that referenced this issue Jan 26, 2024
syzonyuliia pushed a commit that referenced this issue Jan 26, 2024
syzonyuliia pushed a commit that referenced this issue Jan 29, 2024
syzonyuliia pushed a commit that referenced this issue Jan 29, 2024
syzonyuliia pushed a commit that referenced this issue Jan 31, 2024
syzonyuliia pushed a commit that referenced this issue Feb 1, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 5, 2024
wendycwong pushed a commit that referenced this issue Feb 12, 2024
* GH-15809: implement AIC and Loglikelihood calculation for GenericModel

* GH-15809: add AIC and Loglikelihood to ModelMetricsBinomial

* GH-15809: implement AIC and Loglikelihood calculations for ModelMetricsBinomial

* GH-15809: add AIC and Loglikelihood to output metrics

* GH-15809: update test to check AIC and Loglikelihood calculation for loaded model

* GH-15809: correct betas source

* GH-15809: implement AIC and loglikelihood calculation for multinomial generic glm

* GH-15809: minor aic retrieval fix

* GH-15809: enable loglikelihood and AIC calculation for multinomial family

* GH-15809: remove prints

* GH-15809: refactor

* GH-15809: add new parameter to the constructor, and add new constructor

* GH-15809: add dispersion_estimated parameter to GLM mojo

* GH-15809: update and fix tests

* GH-15809: fix metrics exposure in python

* GH-15809: fix parameters

* GH-15809: add null check

* GH-15809: fix tests

* GH-15809: fix R tests

* GH-15809: fix reading new parameter in MOJO load

* GH-15809: fix writing new parameter in MOJO load

* GH-15809: fix value

* GH-15809: fix comments

* GH-15809: fix printing metrics

* GH-15809: remove commented code

* GH-15809: assign NaN instead of 0 as placeholder value for Loglikelihood

* GH-15809: default dispersion estimation set to 1

* GH-15809: clean test

* GH-15809: fix aic check in test

* GH-15809: additionally fix aic check in test

* GH-15809: additionally fix aic check in test

* GH-15809: fit test - add default parameters

* Fixed test discrepancies.

* only return AIC and loglikelihood for glm models

* fixed AIC problem when model is not glm

* Incorporate Tomas F review.

* replace m != null && m.getClass().toString().contains(generic) with score4Generic

---------

Co-authored-by: syzonyuliia <[email protected]>
Co-authored-by: wendycwong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants