This chapter compares the different methods used to create counterfactuals by examining the impacts on the new predictions made by the classifiers (aware and unaware).
We also need the predictions made by the classifier (see Chapter 5):
# Predictions on train/test setsload("../data/pred_aware.rda")load("../data/pred_unaware.rda")# Predictions on the factuals, on the whole datasetload("../data/pred_aware_all.rda")load("../data/pred_unaware_all.rda")
We create a tibble with the factuals and the predictions by the aware model, an another with the predictions by the unaware model:
Let us focus on the first three Black individuals from the dataset. We will compare the predicted values by the classifier (see Chapter 5) made using the observed characteristics, and the changes in the predictions when using counterfactuals. We use the three types of counterfactuals explored in the previous chapters.