diff --git a/R/model_performance.lm.R b/R/model_performance.lm.R index d8e7d76eb..f03ee726e 100644 --- a/R/model_performance.lm.R +++ b/R/model_performance.lm.R @@ -125,10 +125,10 @@ model_performance.lm <- function(model, metrics = "all", verbose = TRUE, ...) { if (("LOGLOSS" %in% toupper(metrics)) && isTRUE(info$is_binomial)) { out$Log_loss <- .safe({ .logloss <- performance_logloss(model, verbose = verbose) - if (!is.na(.logloss)) { - .logloss - } else { + if (is.na(.logloss)) { NULL + } else { + .logloss } }) }