{"id":20723576,"url":"https://github.com/networks-learning/towards-human-ai-complementarity-predictions-sets","last_synced_at":"2026-01-29T00:03:07.533Z","repository":{"id":241759032,"uuid":"804962824","full_name":"Networks-Learning/towards-human-ai-complementarity-predictions-sets","owner":"Networks-Learning","description":"Code for \"Towards Human-AI Complementarity with Prediction Sets\", NeurIPS 2024","archived":false,"fork":false,"pushed_at":"2024-10-29T13:08:01.000Z","size":36302,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-04T02:20:00.592Z","etag":null,"topics":["conformal-prediction","decision-support-systems","human-ai-complementarity"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2405.17544","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/Networks-Learning.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}},"created_at":"2024-05-23T15:58:29.000Z","updated_at":"2024-10-29T13:08:24.000Z","dependencies_parsed_at":"2025-04-23T17:50:07.287Z","dependency_job_id":null,"html_url":"https://github.com/Networks-Learning/towards-human-ai-complementarity-predictions-sets","commit_stats":null,"previous_names":["networks-learning/towards-human-ai-complementarity-predictions-sets"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Networks-Learning/towards-human-ai-complementarity-predictions-sets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Networks-Learning%2Ftowards-human-ai-complementarity-predictions-sets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Networks-Learning%2Ftowards-human-ai-complementarity-predictions-sets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Networks-Learning%2Ftowards-human-ai-complementarity-predictions-sets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Networks-Learning%2Ftowards-human-ai-complementarity-predictions-sets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Networks-Learning","download_url":"https://codeload.github.com/Networks-Learning/towards-human-ai-complementarity-predictions-sets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Networks-Learning%2Ftowards-human-ai-complementarity-predictions-sets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28856911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"ssl_error","status_checked_at":"2026-01-28T22:56:00.861Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["conformal-prediction","decision-support-systems","human-ai-complementarity"],"created_at":"2024-11-17T04:09:08.376Z","updated_at":"2026-01-29T00:03:07.517Z","avatar_url":"https://github.com/Networks-Learning.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Towards Human-AI Complementarity with Prediction Sets\n\nThis repository is the official implementation of [Towards Human-AI Complementarity with Prediction Sets](https://arxiv.org/abs/2405.17544).\n\n## Requirements\n\nThis code was tested on Python 3.8 and on a Linux machine. The main prerequisite to run our experiments is to have a working MPI implementation (see [here](https://docs.open-mpi.org/en/v5.0.x/installing-open-mpi/quickstart.html) for additional instructions), since our scripts natively support multiprocessing.\nYou will need a working Latex installation to instead run the scripts generating the plots available in the manuscript.\nOn a Linux machine, please run the following to install the packages within a [conda](https://conda.io/projects/conda/en/latest/index.html) environment:\n\n```bash\nconda create --name hai-psets python=3.8\nconda activate hai-psets\npip install -r requirements.txt\n```\n\n## Evaluation\n\nIn order to run our scripts, make sure to position yourself in the base directory and to activate the correct environment.\n\n```bash\ncd towards-human-ai-complementarity-predictions-sets\nconda activate hai-psets\nexport PYTHONPATH=.\n```\n\nPlease have a look to the following bash script running all of our experiments and analysis:\n- `run_all_synthetic.sh`: run the synthetic experiment detailed in Section 5 (it might take some time).\n- `run_all_real_data.sh`: run the real data experiment detailed in Section 6 (it might take some time).\n- `generate_all_plots.sh`: generate all plots presented in the paper.\n- `generale_all_results.sh`: generate the Latex code for the various tables presented in the paper.\n\n### Running synthetic experiments\n\nThe script `run_synthetic_experiment.py` runs the synthetic experiments detailed in Section 5. Below you can find its invocation for all the prediction tasks with 10 labels where we apply calibration to the model. The `mpirun -n 2` invocation parallelizes the execution over 2 physical cores.\n\n```bash\nmpirun -n 2 python run_synthetic_experiment.py --calibrate --labels 10\n```\n\n### Running experiments with real data\n\nThe script `run_real_experiment.py` runs instead the experiments with the real data. For example, the following command generates the results for the experiment presented in Section 6.\n```bash\nmpirun - n 2 python run_real_experiment.py --model-epochs epoch10 --calibrate top-k --ranks 5 --calibration-size 800\n```\n\n## Repository Structure\n\nThe directories have the following content:\n- `analytics/`: it contains python scripts to parse and analyze the results of the main paper.\n- `data/`: it contains the ImageNet-16H data needed for the experiments and some python utility functions to preprocess them.\n- `results/`: it contains a series of pickle files with our experimental results in a raw format.\n- `utils/`: it contains utility functions and code to run the experiments.\n\n## Citation\nIf you use parts of the code in this repository for your research purposes, please consider citing:\n```\n@article{detoni2024humanai,\n      title={Towards Human-AI Complementarity with Prediction Sets}, \n      author={Giovanni De Toni and Nastaran Okati and Suhas Thejaswi and Eleni Straitouri and Manuel Gomez-Rodriguez},\n      year={2024},\n      journal={arXiv preprint arXiv:2405.17544}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworks-learning%2Ftowards-human-ai-complementarity-predictions-sets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetworks-learning%2Ftowards-human-ai-complementarity-predictions-sets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworks-learning%2Ftowards-human-ai-complementarity-predictions-sets/lists"}