Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Dec 1, 2023
1 parent 306999c commit f9b902f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/performance_score.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
Expand Down

0 comments on commit f9b902f

Please sign in to comment.