library(dplyr)
data(hpc_cv)
head(hpc_cv)
# evaluate `equal_opportunity()` by Resample
m_set <- metric_set(equal_opportunity(Resample))
# use output like any other metric set
hpc_cv %>%
m_set(truth = obs, estimate = pred)
# can mix fairness metrics and regular metrics
m_set_2 <- metric_set(sens, equal_opportunity(Resample))
hpc_cv %>%
m_set_2(truth = obs, estimate = pred)
Run the code above in your browser using DataLab