tybrs commited on
Commit
77a7a3e
1 Parent(s): 11131a9

Update bias_auc.py

Browse files

changed output name from "Overall" to "Overall generalized mean"

Files changed (1) hide show
  1. bias_auc.py +5 -5
bias_auc.py CHANGED
@@ -138,18 +138,18 @@ class BiasAUC(evaluate.Metric):
138
 
139
  def _update_overall(self, result, labels, outputs, power_value=-5):
140
  """Compute the generalized mean of Bias AUCs"""
141
- result['Overall'] = {}
142
  for metric in ['Subgroup', 'BPSN', 'BNSP']:
143
  metric_values = np.array([result[community][metric] for community in result
144
- if community != 'Overall'])
145
  metric_values **= power_value
146
  mean_value = np.power(np.sum(metric_values)/(len(result) - 1), 1/power_value)
147
- result['Overall'][f"{metric} generalized mean"] = mean_value
148
  y_preds = [output[1] for output in outputs]
149
  try:
150
- result['Overall']["Overall AUC"] = roc_auc_score(labels, y_preds)
151
  except ValueError:
152
- result['Overall']["Overall AUC"] = np.nan
153
  return result
154
 
155
  def _compute(self, target, label, output, subgroups=None):
 
138
 
139
  def _update_overall(self, result, labels, outputs, power_value=-5):
140
  """Compute the generalized mean of Bias AUCs"""
141
+ result['Overall generalized mean'] = {}
142
  for metric in ['Subgroup', 'BPSN', 'BNSP']:
143
  metric_values = np.array([result[community][metric] for community in result
144
+ if community != 'Overall generalized mean'])
145
  metric_values **= power_value
146
  mean_value = np.power(np.sum(metric_values)/(len(result) - 1), 1/power_value)
147
+ result['Overall'][f"{metric}"] = mean_value
148
  y_preds = [output[1] for output in outputs]
149
  try:
150
+ result['Overall generalized mean']["Overall AUC"] = roc_auc_score(labels, y_preds)
151
  except ValueError:
152
+ result['Overall generalized mean']["Overall AUC"] = np.nan
153
  return result
154
 
155
  def _compute(self, target, label, output, subgroups=None):