Skip to content

Commit

Permalink
GH-15809: add AIC and Loglikelihood to output metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
syzonyuliia-h2o committed Jan 17, 2024
1 parent 566eb00 commit 8f66d3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public S fillFromImpl(ModelMetricsBinomial modelMetrics) {
// sigma = modelMetrics._sigma;
r2 = modelMetrics.r2();
logloss = modelMetrics._logloss;
loglikelihood = modelMetrics._loglikelihood;
AIC = modelMetrics._aic;
mean_per_class_error = modelMetrics._mean_per_class_error;


Expand Down
5 changes: 4 additions & 1 deletion h2o-py/h2o/model/metrics_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ def _str_items(self, verbosity=None):
"Null deviance: {}".format(self.null_deviance()),
"Residual deviance: {}".format(self.residual_deviance()),
])
if is_type(self.aic(), numeric): items.append("AIC: {}".format(self.aic()))
if is_type(self.aic(), numeric) and self.loglikelihood() != 0:
items.append("AIC: {}".format(self.aic()))
if is_type(self.loglikelihood(), numeric) and self.loglikelihood() != 0:
items.append("Loglikelihood: {}".format(self.loglikelihood()))
items.extend(self._str_items_custom())
return items

Expand Down

0 comments on commit 8f66d3e

Please sign in to comment.