In the all_cutoffs function we can read:
# like in create fobject
gmm <- calculate_group_fairness_metrics(group_matrices)
gmm_scaled <- abs(apply(gmm, 2 , function(x) x - gmm[,privileged]))
gmm_loss <- rowSums(gmm_scaled)
but the parity loss in fairness_check is computed this way:
# group metric matrix
gmm <- calculate_group_fairness_metrics(group_matrices)
# from every column in matrix subtract base column, then get abs value
# in other words we measure distance between base group
# metrics score and other groups metric scores
gmm_scaled <- apply(gmm, 2 , function(x) x / gmm[, privileged])
gmm_abs <- apply(gmm_scaled, 2 , function(x) sapply(x, function(y) abs(log(y))))
gmm_loss <- rowSums(gmm_abs)
Why is the loss function not the same?
In the
all_cutoffsfunction we can read:but the parity loss in
fairness_checkis computed this way:Why is the loss function not the same?