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

Bias and bug fix #63

Merged
merged 47 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d236295
Add bias analyzer for tabular data
yangwenz Dec 12, 2022
0b07e22
Add bias analyzer for tabular data
yangwenz Dec 12, 2022
3ca6ea5
Add bias analyzer for tabular data
yangwenz Dec 12, 2022
639d81e
Add bias analyzer for tabular data
yangwenz Dec 12, 2022
0fd66b5
Add bias analyzer for tabular data
yangwenz Dec 12, 2022
9df5ab5
Add bias analyzer for tabular data
yangwenz Dec 12, 2022
722effb
Add bias analyzer for tabular data
yangwenz Dec 12, 2022
fef8434
Add bias analyzer for tabular data
yangwenz Dec 12, 2022
9482aea
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
1c57013
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
6f9fccd
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
379e67f
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
b9a2717
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
51f724a
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
5d9d457
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
2423e15
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
9bac664
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
6db96be
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
11ad6a6
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
73c18a9
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
aa43be6
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
befc11c
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
41ae228
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
36cb571
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
311192d
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
ebee3c6
Revise the plotly plot
yangwenz Dec 13, 2022
22702e2
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
0c631c6
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
a97434e
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
d4cb531
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
ee60388
Revise the plotly plot
yangwenz Dec 13, 2022
3f408e4
Revise the plotly plot
yangwenz Dec 13, 2022
1b9574f
Revise the prediction function
yangwenz Dec 13, 2022
11d3a27
Revise the prediction function
yangwenz Dec 13, 2022
adaccdc
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
73bd3a8
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
66bfc3f
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
12aa873
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
a07286f
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
b93804c
Add bias analyzer for tabular data
yangwenz Dec 13, 2022
10a6746
Update setup.py
yangwenz Dec 13, 2022
b56f72a
Add bias analyzer for tabular data
yangwenz Dec 14, 2022
a8ad928
Add bias analyzer for tabular data
yangwenz Dec 14, 2022
4846819
Revise the value range
yangwenz Dec 14, 2022
edec180
Fix the kwargs issue
yangwenz Jan 3, 2023
acbf707
Fix the bug
yangwenz Jan 3, 2023
355264c
Fix the bug
yangwenz Jan 3, 2023
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
Prev Previous commit
Next Next commit
Add bias analyzer for tabular data
  • Loading branch information
yangwenz committed Dec 13, 2022
commit 73c18a9b192ddd5b3366932fb8d08f16e2722034
2 changes: 2 additions & 0 deletions omnixai/explainers/tabular/agnostic/bias.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ def explain(
group_a = [i for i, v in enumerate(values) if v <= feature_value_or_threshold]
group_b = [i for i, v in enumerate(values) if v > feature_value_or_threshold]

assert len(group_a) > 0, "The first group (advantaged group) for bias analysis is empty."
assert len(group_b) > 0, "The second group (disadvantaged group) for bias analysis is empty."
metric_class = _BiasMetricsForClassification if self.mode == "classification" \
else _BiasMetricsForRegression
targ_a, targ_b, pred_a, pred_b, targets = \
Expand Down
2 changes: 1 addition & 1 deletion omnixai/tests/explainers/bias/test_bias_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_classification_metric(self):
)
explainer.explain(
feature_column="Sex",
feature_value_or_groups="Female"
feature_value_or_threshold="Female"
)


Expand Down