From f9b902f5d1213275437dfce79c0ddd414c105cea Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 1 Dec 2023 08:43:52 +0100 Subject: [PATCH] fix --- R/performance_score.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/performance_score.R b/R/performance_score.R index cd5b7efd6..e65ae820a 100644 --- a/R/performance_score.R +++ b/R/performance_score.R @@ -124,9 +124,9 @@ performance_score <- function(model, verbose = TRUE, ...) { } else { datawizard::to_numeric(resp, dummy_factors = FALSE, preserve_levels = TRUE) } - p_y <- .safe(prob_fun(resp, mean = pr$pred, pis = pr$pred_zi, sum(resp))) + p_y <- .safe(suppressWarnings(prob_fun(resp, mean = pr$pred, pis = pr$pred_zi, sum(resp)))) - if (is.null(p_y)) { + if (is.null(p_y) || all(is.na(p_y))) { if (verbose) { insight::format_alert("Can't calculate proper scoring rules for this model.") }