Skip to content

Commit

Permalink
raise exception if regression task with fairness metric group_loss_di…
Browse files Browse the repository at this point in the history
…fference and fairness threshold value not set (#612)
  • Loading branch information
pplonski committed Jun 13, 2023
1 parent d1b87f4 commit 04767fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion supervised/base_automl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2228,9 +2228,10 @@ def _get_fairness_threshold(self):
return thresholds.get(self._fairness_metric, 0.8)
elif self._get_ml_task() == REGRESSION:
thresholds = {
"group_loss_difference": 0.1,
"group_loss_ratio": 0.8,
}
if self._fairness_metric == "group_loss_difference":
raise AutoMLException("We can't set default fairness threshold value. Please set `fairness_threshold` value in AutoML constructor.")
return thresholds.get(self._fairness_metric, 0.8)
else:
return deepcopy(self.fairness_threshold)
Expand Down

0 comments on commit 04767fd

Please sign in to comment.