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

A few bugs involved "tests.sh" #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.idea/
.vscode/
.ipynb_checkpoints
*/.ipynb_checkpoints
__pycache__
*/__pycache__
1 change: 1 addition & 0 deletions agents/threshold_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def equality_of_opportunity_thresholds(group_predictions,
sample_weight=group_weights[group])

roc[group] = (fprs, np.nan_to_num(tprs), thresholds)
# roc[group] = (np.nan_to_num(fprs), np.nan_to_num(tprs), thresholds)

def negative_reward(tpr_target):
"""Returns negative reward suitable for optimization by minimization."""
Expand Down
3 changes: 2 additions & 1 deletion examples/college_admission_util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def test_example_configuration_runs(self):
referred to in college_admission_config.gin configuration file.
"""
gin.parse_config_file(
'third_party/py/fairness_gym/examples/config/'
# 'third_party/py/fairness_gym/examples/config/'
'examples/config/'
'college_admission_config.gin')
runner = runner_lib.Runner()
runner.run()
Expand Down
20 changes: 14 additions & 6 deletions examples/config/college_admission_config.gin
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import fairness_gym.agents.college_admission_jury
import fairness_gym.environments.college_admission
import fairness_gym.examples.college_admission_util
import fairness_gym.metrics.error_metrics
import fairness_gym.metrics.value_tracking_metrics
import fairness_gym.runner_lib
# import fairness_gym.agents.college_admission_jury
# import fairness_gym.environments.college_admission
# import fairness_gym.examples.college_admission_util
# import fairness_gym.metrics.error_metrics
# import fairness_gym.metrics.value_tracking_metrics
# import fairness_gym.runner_lib

import agents.college_admission_jury
import environments.college_admission
import examples.college_admission_util
import metrics.error_metrics
import metrics.value_tracking_metrics
import runner_lib


# Configure the runner.
Runner.num_steps = 3000
Expand Down
2 changes: 1 addition & 1 deletion examples/docs/college_admission_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ contexts, even if the agent is not designed to anticipate strategic manipulation
To run the experiments for the college admissions scenario to recreate the plots
from the KDD 2019 paper [4] run the following command:

`python examples/college_admissions_main --num_steps=750 --burnin=10
`python examples/college_admissions_main.py --num_steps=750 --burnin=10
--epsilon_greedy=False --verbose=True --noisy_dist='gaussian'
--noisy_features=False --noisy_threshold=False --feature_mu='0.5','0.5'
--output_dir="path/to/output_dir/kdd"`
Expand Down
2 changes: 1 addition & 1 deletion examples/docs/lending_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ over the course of the simulation. Precision and Recall stratified by group.

## Interpreting the plots

Running examples/lending_experiment_main.py reproduces the plots for the KDD
Running examples/lending_experiments_main.py reproduces the plots for the KDD
workshop paper [3].

The cumulative loans given to each group are plotted over the course of the
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ simplejson
sklearn
statsmodels
tqdm

gin-config==0.1.1
mock
scikit-learn==0.20.2 # better not to use 0.19.1