Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/bias mitigation #8

Merged
merged 7 commits into from
Dec 6, 2023
Merged

Bugfix/bias mitigation #8

merged 7 commits into from
Dec 6, 2023

Conversation

ehsan-s
Copy link
Contributor

@ehsan-s ehsan-s commented Oct 27, 2023

Two minor changes in bias mitigation:

  • Raw reduction has a minor bug, it should calculate the avg of scores for each group.
  • one_vs_all is not the right name for our model metric. It actually computes a given metric on all subgroup pairs for a specified 'subgroups' input.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 27, 2023
@github-actions
Copy link

📌 Overall coverage:

No success to gather report. 😿

@github-actions
Copy link

📌 Overall coverage:

No success to gather report. 😿

@github-actions
Copy link

📌 Overall coverage:

Coverage-82%

@@ -65,7 +64,7 @@ def _one_vs_all_model_metric(
Name of the base metric to be called.
distance_measure : str or None
Determines the distance used to compare a subgroup's metric
against the rest of the population. Possible values are:
against the rest of subgroups. Possible values are:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
against the rest of subgroups. Possible values are:
against the rest of the subgroups. Possible values are:

Here and elsewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

for group, metric in zip(groups, metrics):
res[group] += [metric]
for group in res:
res[group] = sum(res[group])/len(res[group])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look quite right. Are you calculating the mean disparity for all pairs that contain group?

For the raw reduction, we are expecting to see all of the group pairs and the disparity between them.
E.g., {(g1, g2): g1_g2_disparity, (g1, g3): g1_g3_disparity, (g2,g3): g2_g3_disparity}

Copy link
Contributor Author

@ehsan-s ehsan-s Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I did average based on None reduction definition on docs and the groups parameter which was only unpriv_group in call(self, groups, metrics)
Now, I changed groups to be subgroup_pairs [(g1, g2), ...], and fixed the reduction to return {(g1,g2): metric, ...}

@mingkang111
Copy link
Member

Hi @ehsan-s , could you please pull the change from the main branch? There are some updates to fix the failed
guidelines/oracle check.

Copy link

github-actions bot commented Nov 9, 2023

📌 Overall coverage:

No success to gather report. 😿

1 similar comment
Copy link

github-actions bot commented Nov 9, 2023

📌 Overall coverage:

No success to gather report. 😿

Copy link

github-actions bot commented Nov 9, 2023

📌 Overall coverage:

Coverage-81%

@ehsan-s
Copy link
Contributor Author

ehsan-s commented Nov 9, 2023

@YashaPushak Some new changes on _dataset_metric function is applied, please review again!

Copy link

github-actions bot commented Nov 9, 2023

📌 Overall coverage:

No success to gather report. 😿

Copy link

github-actions bot commented Nov 9, 2023

📌 Overall coverage:

Coverage-82%

Copy link

github-actions bot commented Nov 9, 2023

📌 Overall coverage:

No success to gather report. 😿

YashaPushak
YashaPushak previously approved these changes Nov 21, 2023
Copy link
Member

@YashaPushak YashaPushak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

Copy link

github-actions bot commented Dec 5, 2023

📌 Overall coverage:

No success to gather report. 😿

1 similar comment
Copy link

github-actions bot commented Dec 5, 2023

📌 Overall coverage:

No success to gather report. 😿

Copy link

github-actions bot commented Dec 5, 2023

📌 Overall coverage:

Coverage-82%

@mingkang111 mingkang111 merged commit e9e452f into main Dec 6, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants