{"id":15288183,"url":"https://github.com/opt-mucca/pyscipopt-ml","last_synced_at":"2025-04-13T05:34:49.923Z","repository":{"id":211789834,"uuid":"729943738","full_name":"Opt-Mucca/PySCIPOpt-ML","owner":"Opt-Mucca","description":"Python interface to automatically formulate Machine Learning models into Mixed-Integer Programs","archived":false,"fork":false,"pushed_at":"2025-02-26T10:27:35.000Z","size":2667,"stargazers_count":26,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-11T22:44:54.220Z","etag":null,"topics":["artificial-intelligence","decision-trees","keras","lightgbm","machine-learning","mathematical-programming","mixed-integer-optimization","mixed-integer-programming","neural-networks","optimization","python","pytorch","sklearn","surrogate-models","xgboost"],"latest_commit_sha":null,"homepage":"https://pyscipopt-ml.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Opt-Mucca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":"docs/supported.rst","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-10T20:28:22.000Z","updated_at":"2025-03-13T07:55:32.000Z","dependencies_parsed_at":"2024-08-05T21:49:06.976Z","dependency_job_id":"bf09d153-87cc-4420-95e3-63dcb560ae2b","html_url":"https://github.com/Opt-Mucca/PySCIPOpt-ML","commit_stats":null,"previous_names":["opt-mucca/pyscipopt-ml"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Opt-Mucca%2FPySCIPOpt-ML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Opt-Mucca%2FPySCIPOpt-ML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Opt-Mucca%2FPySCIPOpt-ML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Opt-Mucca%2FPySCIPOpt-ML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Opt-Mucca","download_url":"https://codeload.github.com/Opt-Mucca/PySCIPOpt-ML/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670517,"owners_count":21142896,"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","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":["artificial-intelligence","decision-trees","keras","lightgbm","machine-learning","mathematical-programming","mixed-integer-optimization","mixed-integer-programming","neural-networks","optimization","python","pytorch","sklearn","surrogate-models","xgboost"],"created_at":"2024-09-30T15:44:35.577Z","updated_at":"2025-04-13T05:34:49.911Z","avatar_url":"https://github.com/Opt-Mucca.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Python versions](https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10%20|%203.11%20|%203.12%20|%203.13-blue)\n[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![PyPI](https://img.shields.io/pypi/v/pyscipopt-ml)](https://pypi.org/project/pyscipopt-ml)\n\n![](docs/_static/pyscipoptml-summary.png)\n\n# PySCIPOpt-ML\n\nPySCIPOpt-ML is a python interface to automatically formulate Machine Learning (ML) models into Mixed-Integer Programs (MIPs).\nPySCIPOPT-ML allows users to easily optimise MIPs with embedded ML constraints.\n\nThe package currently supports various ML objects from [Scikit-Learn](https://scikit-learn.org/stable/),\n[XGBoost](https://xgboost.readthedocs.io/en/stable/), [LightGBM](https://lightgbm.readthedocs.io/en/stable/),\n[PyTorch](https://pytorch.org/), [Keras](https://keras.io/), and [ONNX](https://onnx.ai/).\n\n![](docs/_static/pyscipoptml-flowchart.png)\n\n# Documentation\n\nThe latest user manual is available on [readthedocs](https://pyscipopt-ml.readthedocs.io/).\n\n# Contact us\n\nFor reporting bugs, issues and feature requests please\n[open an issue](https://github.com/Opt-Mucca/PySCIPOpt-ML/issues).\n\n# Installation\n\n## Dependencies\n\n`pyscipopt-ml` requires the following:\n- Python \u003e= 3.8\n- [`numpy`](https://pypi.org/project/numpy/) \u003e= 1.23.0\n- [`pyscipopt`](https://pypi.org/project/pyscipopt/) \u003e= 5.4.1\n\nThe current version supports the following ML packages:\n- [`torch`](https://pypi.org/project/torch/)\n- [`keras`](https://pypi.org/project/tensorflow/)\n- [`scikit-learn`](https://pypi.org/project/scikit-learn)\n- [`XGBoost`](https://pypi.org/project/xgboost/)\n- [`LightGBM`](https://pypi.org/project/lightgbm/)\n- [`onnx`](https://pypi.org/project/onnx/)\n\nInstalling these packages is only required if the predictor you want to insert uses them\n(i.e. to insert a XGBoost based predictor you need to have `xgboost` installed).\n\n## Pip installation\n\nThe easiest way to install `PySCIPOpt-ML` is using `pip`.\nIt is recommended to always install packages in a virtual environment:\n```shell\n(venv) pip install pyscipopt-ml\n```\nThis will also install the `numpy` and `pyscipopt` dependencies.\n\n## Installation from source\n\nAn alternative way to install `PySCIPOpt-ML` is from source. First this repository\nneeds to be cloned. This can be achieved via HTTPS with:\n```shell\ngit clone https://github.com/Opt-Mucca/PySCIPOpt-ML/\n```\nand SHH with\n```shell\ngit clone git@github.com:Opt-Mucca/PySCIPOpt-ML.git\n```\n\nAfter cloning the repository entering the directory where it was cloned, one can run the command:\n```shell\n(venv) python -m pip install .\n```\n\n# Development\nThis project is completely open to any contributions. Feel free to implement your own functionalities.\n\nBefore committing anything, please install pytest, pre-commit, and all ML frameworks:\n\n```shell\npip install pytest\npip install scikit-learn\npip install torch\npip install tensorflow\npip install xgboost\npip install lightgbm\npip install onnx\npip install onnxruntime\npip install pre-commit\npre-commit install\n```\n\n## Source code\nYou can clone the latest sources with the command:\n```shell\ngit clone git@github.com:Opt-Mucca/PySCIPOpt-ML.git\n```\n\n## Documentation\nYou can build the documentation locally with the command\n```shell\npip install -r docs/requirements.txt\nsphinx-build docs docs/_build\n```\nÀs the documentation requires additional python packages, one should run the following command\nbefore building the documentation for the first time:\n```shell\n(venv) pip install -r docs/requirements.txt\n```\n\n## Testing\nAfter cloning the project, you can run the tests by invoking `pytest`. For this, you will need to create a virtual\nenvironment and activate it. Please also make sure to append your python path:\n```shell\npython -m venv venv\nsource venv/bin/activate\nexport PYTHONPATH=\"$(pwd):${PYTHONPATH}\"\n```\nThen, you can install `pytest` and run a few basic tests:\n```shell\n(venv) pip install pytest\n(venv) pytest\n```\n\n## How to cite this work\n\nIf this software was used for academic purposes, please cite our paper with the below information:\n\n```\n@misc{turner2024pyscipoptmlembeddingtrainedmachine,\n      title={PySCIPOpt-ML: Embedding Trained Machine Learning Models into Mixed-Integer Programs},\n      author={Mark Turner and Antonia Chmiela and Thorsten Koch and Michael Winkler},\n      year={2024},\n      eprint={2312.08074},\n      archivePrefix={arXiv},\n      primaryClass={math.OC},\n      url={https://arxiv.org/abs/2312.08074},\n}\n```\n\n## Funding Acknowledgements\n\nThe work for this article has been conducted in the Research Campus MODAL\nfunded by the German Federal Ministry of Education and Research (BMBF)\n(fund numbers 05M14ZAM, 05M20ZBM).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopt-mucca%2Fpyscipopt-ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopt-mucca%2Fpyscipopt-ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopt-mucca%2Fpyscipopt-ml/lists"}