Code Monkey home page Code Monkey logo

counterfactually-harmless-matching's Introduction

Matchings, Predictions and Counterfactual Harm in Refugee Resettlement Processes

This repository is the official implementation of Matchings, Predictions and Counterfactual Harm in Refugee Resettlement Processes.

Required packages

  • python == 3.9.13
  • numpy == 1.24.3
  • pandas == 1.5.3
  • scipy == 1.10.1
  • torch == 1.10.0
  • tqdm == 4.65.0

To run the code

Run synthesize_dataset.py for generation of synthetic dataset of refugees. The generation results will be saved in a directory 'data/synthetic_100X5000_10_locations'.

python synthesize_dataset.py --refugee_batch_size [number of refugee in a batch] --refugee_batch_num [number of refugee batches]

Execute extract_classifier_scores.py to extract employment probability of each refugee predicted by biased classifier. The extracted employment probability will be saved in a directory 'save_dir/scores'

python extract_classifier_scores.py --beta [bias of the classifier]

Then, start our proposed postprocessing framework by computing minimally modified weight that is guaranteed to be counterfactually harmless. The adjusted weight will be saved in a directory 'save_dir/problems'

python create_problem.py --epsilon [epsilon used in the algorithm] --w [noise level of the default policy]

Train the deep learning model that learns to avoid counterfactual harm. The trained model and evaluation result will be saved in a directory 'result'

python train_modifier.py

Please see utils/common.py for other possible arguments.

counterfactually-harmless-matching's People

Contributors

archon159 avatar manuelgr avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.