{"id":21258236,"url":"https://github.com/aida-ugent/otf","last_synced_at":"2025-10-12T23:50:19.349Z","repository":{"id":111954788,"uuid":"568384652","full_name":"aida-ugent/OTF","owner":"aida-ugent","description":"Optimal Transport of Classifiers to Fairness (NeurIPS 2022).","archived":false,"fork":false,"pushed_at":"2023-06-01T13:20:09.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-09T01:22:57.364Z","etag":null,"topics":["fairness","optimal-transport","pytorch","regularizer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aida-ugent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-20T11:21:44.000Z","updated_at":"2023-11-23T14:08:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"88b706fa-6b6e-4c9f-8067-1abe92fb5be1","html_url":"https://github.com/aida-ugent/OTF","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aida-ugent/OTF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aida-ugent%2FOTF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aida-ugent%2FOTF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aida-ugent%2FOTF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aida-ugent%2FOTF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aida-ugent","download_url":"https://codeload.github.com/aida-ugent/OTF/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aida-ugent%2FOTF/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013415,"owners_count":26085274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fairness","optimal-transport","pytorch","regularizer"],"created_at":"2024-11-21T04:07:51.616Z","updated_at":"2025-10-12T23:50:19.344Z","avatar_url":"https://github.com/aida-ugent.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Optimal Transport to Fairness (OTF)\n\nThis project contains an accessible implementation of the OTF cost function proposed in the paper *Optimal Transport of Classifiers to Fairness* published at NeurIPS 2022. \n\nThe OTF cost projects a probability distribution to the closest distribution in the set of all fair distributions, where closeness is defined in terms of Optimal Transport cost. As such, OTF quantifies the unfairness of a model while taking the input features of individuals into account.\n\n\n### Use\n\nAn example use of the OTF method for the Adult dataset is given in `main.py` . The actual implementation of the cost is in `otf.otf_cost`, where a fairness notion as given in `otf.linear_fairness_notion` is expected. In `otf.predictor`, a generic probabilistic model is implemented that uses the OTF cost as an additional cost term to optimize during training. Finally, `otf.evaluation` computes some metrics as explained in the paper.\n\nWhen using the OTF cost, please make sure to tune the `reg_strength` hyperparameter at the very least, e.g. in the range `[0.01, 0.001, 0.0001]`. Also, the computation of the OTF cost can be sped up by reducing the `nb_epochs` parameter and increasing the `margin_tol` and `constraint_tol`. \n\n\n### Citation\n\nIf you found our code useful, please cite our paper:\n\n    @inproceedings{buyl2022otf,\n        title = {Optimal Transport of Classifiers to Fairness},\n        author = {Buyl, Maarten and De Bie, Tijl},\n        booktitle = {Advances in Neural Information Processing Systems},\n        volume = {35},\n        pages = {33728--33740},\n        year = {2022}\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faida-ugent%2Fotf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faida-ugent%2Fotf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faida-ugent%2Fotf/lists"}