Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fairlib/src/evaluators/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def Aggregation_GAP(distinct_groups, all_scores, metric="TPR", group_agg_power =
# n_class * n_groups
Scores = np.stack(group_scores, axis = 1)
# Calculate GAP (n_class * n_groups) - (n_class * 1)
score_gaps = Scores / all_scores["overall"][metric].reshape(-1,1)
score_gaps = Scores - all_scores["overall"][metric].reshape(-1,1)
# Sum over gaps of all protected groups within each class
if group_agg_power is None:
score_gaps = np.sum(abs(score_gaps),axis=1)
Expand Down Expand Up @@ -144,7 +144,7 @@ def Aggregation_Ratio(distinct_groups, all_scores, metric="TPR", group_agg_power
# n_class * n_groups
Scores = np.stack(group_scores, axis = 1)
# Calculate GAP (n_class * n_groups) - (n_class * 1)
score_ratios = Scores - all_scores["overall"][metric].reshape(-1,1)
score_ratios = Scores / all_scores["overall"][metric].reshape(-1,1)
# Sum over ratios of all protected groups within each class
if group_agg_power is None:
score_ratios = np.sum(abs(score_ratios),axis=1)
Expand Down