plot.all_cutoffs | R Documentation |
All cutoffs plot allows to check how parity loss of chosen metrics is affected by the change of cutoff. Values of cutoff
are the same for all subgroups (levels of protected variable) no matter what cutoff values were in fairness_object
.
## S3 method for class 'all_cutoffs' plot(x, ..., label = NULL)
x |
|
... |
other plot parameters |
label |
character, label of model to plot. Default NULL. If default prints all models. |
ggplot2
object
data("german") y_numeric <- as.numeric(german$Risk) - 1 lm_model <- glm(Risk ~ ., data = german, family = binomial(link = "logit") ) explainer_lm <- DALEX::explain(lm_model, data = german[, -1], y = y_numeric) fobject <- fairness_check(explainer_lm, protected = german$Sex, privileged = "male" ) ac <- all_cutoffs(fobject) plot(ac) rf_model <- ranger::ranger(Risk ~ ., data = german, probability = TRUE, num.trees = 100, seed = 1 ) explainer_rf <- DALEX::explain(rf_model, data = german[, -1], y = y_numeric ) fobject <- fairness_check(explainer_rf, fobject) ac <- all_cutoffs(fobject) plot(ac)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.