print_fairness_regression_object: Print Fairness Regression Object

print.fairness_regression_objectR Documentation

Print Fairness Regression Object

Description

Print Fairness Regression Object

Usage

## S3 method for class 'fairness_regression_object'
print(x, ..., colorize = TRUE)

Arguments

x

fairness_regression_object object

...

other parameters

colorize

logical, whether information about metrics should be in color or not

Examples


set.seed(123)
data <- data.frame(
  x = c(rnorm(500, 500, 100), rnorm(500, 400, 200)),
  pop = c(rep("A", 500), rep("B", 500))
)

data$y <- rnorm(length(data$x), 1.5 * data$x, 100)

# create model
model <- lm(y ~ ., data = data)

# create explainer
exp <- DALEX::explain(model, data = data, y = data$y)

# create fobject
fobject <- fairness_check_regression(exp, protected = data$pop, privileged = "A")

# results

fobject


model_ranger <- ranger::ranger(y ~ ., data = data, seed = 123)
exp2 <- DALEX::explain(model_ranger, data = data, y = data$y)

fobject <- fairness_check_regression(exp2, fobject)

# results
fobject



fairmodels documentation built on Aug. 24, 2022, 1:05 a.m.