all_cutoffs | R Documentation |
Create all_cutoffs
object and see how with the change of cutoffs parity loss of fairness metrics changes. Value of cutoff changes equally for all subgroups.
User can pick which fairness metrics to create the object with via fairness_metrics vector.
all_cutoffs( x, grid_points = 101, fairness_metrics = c("ACC", "TPR", "PPV", "FPR", "STP") )
x |
object of class |
grid_points |
numeric, grid for cutoffs to test. Number of points between 0 and 1 spread evenly |
fairness_metrics |
character, name of parity_loss metric or vector of multiple metrics names. Full names can be found in |
all_cutoffs
object, data.frame
containing information about label, metric and parity_loss at particular cutoff
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.