Closed nhward closed 1 year ago
I am getting an error when correctly using "cutoff":
mod1 <- glm(two_year_recid ~ ., data = compas, family = "binomial") expl7 <- DALEX::explain(mod1, data = compas, y = as.numeric(compas$two_year_recid == "Yes"), label = "Thresh", verbose = FALSE) fairmodels::fairness_check(expl7, protected = compas$sex, privileged = "Male", cutoff = list("Male" = 0.65, "Female" = 0.5), epsilon = 0.8, colorize = FALSE, verbose = FALSE)
Error in if (!check_names_in_names_vector(cutoff, protected_levels)) stop("Names of cutoff list does not match levels in protected") : the condition has length > 1
The problem relates to a parameter check. Should the code:
check_names_in_names_vector <- function(x, y) { return(names(x) %in% y) }
not be
check_names_in_names_vector <- function(x, y) { return(all(names(x) %in% y)) }
Thanks, changed in https://github.com/ModelOriented/fairmodels/commit/6498abf116462bf9afcc46fc0227f88279228d85
Great job
I am getting an error when correctly using "cutoff":
The problem relates to a parameter check. Should the code:
not be