Skip to content

Commit

Permalink
GH-15809: additionally fix aic check in test
Browse files Browse the repository at this point in the history
  • Loading branch information
syzonyuliia-h2o authored and wendycwong committed Feb 5, 2024
1 parent 6c46408 commit 22c383a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions h2o-py/h2o/model/metrics_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ def _str_items(self, verbosity=None):
"Residual deviance: {}".format(self.residual_deviance()),
])

if is_type(self.aic(), numeric) and not math.isnan(self.aic()) and self.aic() != 0:
if (m_is_binomial or m_is_regression or m_is_multinomial) and is_type(self.aic(), numeric) and not math.isnan(self.aic()) and self.aic() != 0:
items.append("AIC: {}".format(self.aic()))
if is_type(self.loglikelihood(), numeric) and not math.isnan(self.loglikelihood()) and self.loglikelihood() != 0:
if (m_is_binomial or m_is_regression or m_is_multinomial) and is_type(self.loglikelihood(), numeric) and not math.isnan(self.loglikelihood()) and self.loglikelihood() != 0:
items.append("Loglikelihood: {}".format(self.loglikelihood()))

items.extend(self._str_items_custom())
Expand Down

0 comments on commit 22c383a

Please sign in to comment.