{"id":31225232,"url":"https://github.com/machinelearningbcam/constraint-generation-for-mrcs-uai-2023","last_synced_at":"2025-09-22T00:42:26.404Z","repository":{"id":96955712,"uuid":"608574313","full_name":"MachineLearningBCAM/Constraint-Generation-for-MRCs-UAI-2023","owner":"MachineLearningBCAM","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-20T14:53:10.000Z","size":123238,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-07-20T14:56:29.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MachineLearningBCAM.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-02T09:53:24.000Z","updated_at":"2023-07-20T14:56:51.952Z","dependencies_parsed_at":null,"dependency_job_id":"954d6a79-4db1-462a-88f4-1cc79d471e3d","html_url":"https://github.com/MachineLearningBCAM/Constraint-Generation-for-MRCs-UAI-2023","commit_stats":null,"previous_names":["machinelearningbcam/constraint-generation-for-mrcs-uai-2023"],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/MachineLearningBCAM/Constraint-Generation-for-MRCs-UAI-2023","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningBCAM%2FConstraint-Generation-for-MRCs-UAI-2023","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningBCAM%2FConstraint-Generation-for-MRCs-UAI-2023/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningBCAM%2FConstraint-Generation-for-MRCs-UAI-2023/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningBCAM%2FConstraint-Generation-for-MRCs-UAI-2023/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MachineLearningBCAM","download_url":"https://codeload.github.com/MachineLearningBCAM/Constraint-Generation-for-MRCs-UAI-2023/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningBCAM%2FConstraint-Generation-for-MRCs-UAI-2023/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276329459,"owners_count":25623326,"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-09-21T02:00:07.055Z","response_time":72,"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":[],"created_at":"2025-09-22T00:42:22.724Z","updated_at":"2025-09-22T00:42:26.388Z","avatar_url":"https://github.com/MachineLearningBCAM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Efficient Learning of Minimax Risk Classifiers in High Dimensions\n![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg) [![Ask Me Anything !](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg)](#support-and-authors)\n\nThis repository is the official implementation of [Efficient Learning of Minimax Risk Classifiers in High Dimensions](http://arxiv.org/abs/2306.06649). \n\nThe algorithm proposed in the paper provides efficient learning for 0-1 minimax risk classifiers (MRCs) in high dimensions based on constraint generation. In particular, the iterative algorithm utilizes greedy feature selection to obtain a sequence of MRCs with decreasing worst-case error probability. Such performance assessment at learning provides a trade-off between training time and approximation error.\n\n### Decreasing worst-case errors\n\n\u003cimg src=\"decreasing_worst_case_error.png\" width=\"625\" height=\"500\"/\u003e\n\n### Scalability\n\n\u003cimg src=\"scalability.png\" width=\"625\" height=\"500\"/\u003e\n\n### Worst-case errors and training times using multiple high-dimensional datasets\n\n\u003cimg src=\"worst_case_errors.png\" width=\"625\" height=\"500\"/\u003e\n\n## Requirements\n\nThe standard libraries required are listed in the file `requirements.txt`. To install these libraries using\n\n1) `pip`\n```setup\npip install -r requirements.txt\n```\n\n2) `conda` environment\n```\nconda create --name \u003cenvironment_name\u003e --file requirements.txt\n```\n\nThe code also requires the MRCpy library which can be installed from [this](https://github.com/MachineLearningBCAM/MRCpy) repository. In addition, the implementation of the proposed algorithm utilizes the GUROBI optimizer for which license can be downloaded from [here](https://www.gurobi.com/academia/academic-program-and-licenses/).\n\n## Data\n\nThe repository contains multiple high-dimensional biological datasets to perform experiments as follows - \n\nDataset | Variables | Samples | Classes\n--- | --- | --- | --- \nArcene | 10000 | 200 | 2 \nColon | 2000 | 62 | 2\nCLL_SUB_111 | 11340 | 111 | 3\nDorothea | 100000 | 1150 | 2\nGLI_85 | 22283 | 85 | 2\nGLIOMA | 4434 | 50 | 4\nLeukemia | 7129 | 72 | 3\nLung | 12600 | 203 | 5\nMLL | 12582 | 72 | 3\nOvarian | 15154 | 253 | 2\nProstate_GE | 5966 | 102 | 2\nSMK_CAN_187 | 19993 | 187 | 2\nTOX_171 | 5748 | 171 | 4\n\nThe datasets are available as zip files in this repository in the `Datasets` folder with functions to easily load them an numpy matrices in `load.py`.\n\n## Evaluation\n\nTo reproduce the results in the paper, use the following python scripts:\n\n* param_eps.py : Experiments to study the influence of epsilon parameter and show the monotonic decrease in the worst-case error probability.\n* param_n_max.py : Experiment to analyze the effect of the parameter n_max and show improved efficiency over MRC-LP.\n* scalability.py : Experiments to show the scalability of the different algorithms with increasing number of features.\n* comparison.py : Experiments to compare our method with the state of the art techniques in terms of error and training time.\n* feature_selection.py : Experiment to compare our method as feature selection approach. The experiment is performed for binary classification datasets.\n\nThe implementation of the proposed algorithm along with the LP formulation of MRCs can be found in `Main` folder. The code for the SVM-CG can be found in `Libraries` folder which is forked from [this](https://github.com/wanghaoyue123/Column-and-constraint-generation-for-L1-SVM-and-cousins) respository.\n\nTo reproduce any of the experimental results for any dataset, run the following command - \n\n```\npython \u003cscriptname\u003e \u003cdataset\u003e\n```\n\nThe result corresponding to that experiment and dataset will be saved in the `Results/` folder in the respective folder of the experiment and the dataset.\nFor instance, the experiment for comparing the scalability of different algorithms for the `Ovarian` dataset can be performed as follows - \n\n```\npython3 scalability.py Ovarian\n```\n\nand the corresponding results will be saved in `Results/Scalability/Ovarian/` as CSV.\n\n## Usage\n\nThe proposed algorithm is also implemented in the MRCpy library which can be installed from [here](https://github.com/MachineLearningBCAM/MRCpy). After the installation, one can use the proposed algorithm through the library as follows \n\n```\nfrom MRCpy import MRC\n\n# fitting\nmrc_classif = MRC(loss = '0-1, solver = 'cg', n_max = 100, k_max = 20, eps = 1e-4)\nmrc_classif.fit(X,y)\n\n# prediction\npredicted_labels = mrc_classif.predict(X)\n```\n\nFor further details, please check out the documentation of the library in [here](https://machinelearningbcam.github.io/MRCpy/)\n\n## Support and Authors\n\nKartheek Reddy Bondugula\n\nkbondugula@bcamath.org\n\nSantiago Mazuelas \n\nsmazuelas@bcamath.org\n\nAritz Pérez\n\naperez@bcamath.org\n\n## Citation\n\nIf you find useful the code in your research, please include explicit mention of our work in your publication with the following corresponding entry in your bibliography:\n\n[1] K. Bondugula, S. Mazuelas, A. Pérez \"Efficient Learning of Minimax Risk Classifiers in High Dimensions.\" The 39th Conference on Uncertainty in Artificial Intelligence. PMLR, 2023.\n\nThe corresponding BiBTeX citation is given below:\n\n@InProceedings{BonMazPer23, title = {Efficient Learning of Minimax Risk Classifiers in High Dimensions}, author = {Bondugula, Kartheek and Mazuelas, Santiago and P\\'{e}rez, Aritz}, booktitle = {The 39th Conference on Uncertainty in Artificial Intelligence}, pages = {206--215}, year = {2023}, volume = {216}, series = {Proceedings of Machine Learning Research}, publisher = {PMLR}}\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachinelearningbcam%2Fconstraint-generation-for-mrcs-uai-2023","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmachinelearningbcam%2Fconstraint-generation-for-mrcs-uai-2023","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachinelearningbcam%2Fconstraint-generation-for-mrcs-uai-2023/lists"}