{"id":17642561,"url":"https://github.com/gurobi/gurobi-machinelearning","last_synced_at":"2025-05-15T15:01:56.832Z","repository":{"id":62600812,"uuid":"484499932","full_name":"Gurobi/gurobi-machinelearning","owner":"Gurobi","description":"Formulate trained predictors in Gurobi models","archived":false,"fork":false,"pushed_at":"2025-04-04T08:23:35.000Z","size":58753,"stargazers_count":229,"open_issues_count":12,"forks_count":47,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-07T21:08:30.657Z","etag":null,"topics":["gurobi","machine-learning","mathematical-optimization","python"],"latest_commit_sha":null,"homepage":"https://gurobi-machinelearning.readthedocs.io/","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/Gurobi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2022-04-22T16:24:33.000Z","updated_at":"2025-04-04T08:23:36.000Z","dependencies_parsed_at":"2024-01-08T01:55:44.737Z","dependency_job_id":"d730c6e9-f498-40d0-83d1-099a33a9546e","html_url":"https://github.com/Gurobi/gurobi-machinelearning","commit_stats":{"total_commits":927,"total_committers":11,"mean_commits":84.27272727272727,"dds":"0.34304207119741104","last_synced_commit":"b9dfa473f1c534b04815c295a9c50bce87a27224"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gurobi%2Fgurobi-machinelearning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gurobi%2Fgurobi-machinelearning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gurobi%2Fgurobi-machinelearning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gurobi%2Fgurobi-machinelearning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gurobi","download_url":"https://codeload.github.com/Gurobi/gurobi-machinelearning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247730068,"owners_count":20986404,"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":["gurobi","machine-learning","mathematical-optimization","python"],"created_at":"2024-10-23T08:04:29.045Z","updated_at":"2025-05-15T15:01:56.799Z","avatar_url":"https://github.com/Gurobi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build and test](https://github.com/Gurobi/gurobi-machinelearning/actions/workflows/push.yml/badge.svg?branch=main)](https://github.com/Gurobi/gurobi-machinelearning/actions/workflows/push.yml?query=branch%3Amain++)\n[![build wheel](https://github.com/Gurobi/gurobi-machinelearning/actions/workflows/build_wheel.yml/badge.svg?branch=main)](https://github.com/Gurobi/gurobi-machinelearning/actions/workflows/build_wheel.yml?query=branch%3Amain++)\n![Python versions](https://img.shields.io/badge/python-3.9%20|%203.10%20|%203.11%20|%203.12-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/gurobi-machinelearning)](https://pypi.org/project/gurobi-machinelearning)\n[![Documentation Status](https://readthedocs.org/projects/gurobi-machinelearning/badge/?version=stable)](https://gurobi-machinelearning.readthedocs.io/en/stable/?badge=stable)\n[![Gurobi-forum](https://img.shields.io/badge/Help-Gurobi--Forum-red)](https://support.gurobi.com/hc/en-us/community/topics/10373864542609-GitHub-Projects)\n\n[![Gurobi](https://raw.githubusercontent.com/Gurobi/gurobi-machinelearning/main/docs/source/_static/gurobi_light.png)](https://www.gurobi.com)\n\n\n# Gurobi Machine Learning\n\nGurobi Machine Learning is an [open-source](https://gurobi-machinelearning.readthedocs.io/en/latest/meta/license.html) python package to formulate trained regression models in a [`gurobipy`](https://pypi.org/project/gurobipy/) model to be solved with the Gurobi solver.\n\nThe package currently supports various [scikit-learn](https://scikit-learn.org/stable/) objects. It has limited support for [Keras](https://keras.io/), [PyTorch](https://pytorch.org/) and [XGBoost](https://www.xgboost.ai). Only neural networks with ReLU activation can be used with Keras and PyTorch.\n\n# Documentation\n\nThe latest user manual is available on [readthedocs](https://gurobi-machinelearning.readthedocs.io/).\n\n# Contact us\n\nFor questions related to using Gurobi Machine Learning please use [Gurobi's Forum](https://support.gurobi.com/hc/en-us/community/topics/10373864542609-GitHub-Projects).\n\nFor reporting bugs, issues and feature requests please\n[open an issue](https://github.com/Gurobi/gurobi-machinelearning/issues).\n\nIf you encounter issues with Gurobi or ``gurobipy`` please contact\n[Gurobi Support](https://support.gurobi.com/hc/en-us).\n\n# Installation\n\n## Dependencies\n\n`gurobi-machinelearning` requires the following:\n- Python \u003e= 3.9\n- [`numpy`](https://pypi.org/project/numpy/) \u003e= 1.23.0\n- [`gurobipy`](https://pypi.org/project/gurobipy/) \u003e= 10.0\n- [`scipy`](https://pypi.org/project/scipy/) \u003e= 1.9.3\n\nThe current version supports the following ML packages:\n- [`torch`](https://pypi.org/project/torch/)\n- [`scikit-learn`](https://pypi.org/project/scikit-learn)\n- [`tensorflow`](https://pypi.org/project/tensorflow)\n- [`XGBoost`](https://pypi.org/project/xgboost/)\n\nInstalling these packages is only required if the predictor you want to insert uses them\n(i.e. to insert a Keras based predictor you need to have `tensorflow` installed).\n\nThe up to date supported and tested versions of each package for the last release can be\n[found in the documentation](https://gurobi-machinelearning.readthedocs.io/en/stable/user/start.html#id7).\n\n## Pip installation\n\nThe easiest way to install `gurobi-machinelearning` is using `pip` in a virtual environment:\n```shell\n(.venv) pip install gurobi-machinelearning\n```\nThis will also install the `numpy`, `scipy` and `gurobipy` dependencies.\n\nPlease note that `gurobipy` is commercial software and requires a license. When installed via pip or conda,\n`gurobipy` ships with a free license which is only for testing and can only solve models of limited size.\n\n# Getting a Gurobi License\nAlternatively to the bundled limited license, there are licenses that can handle models of all sizes.\n\nAs a student or staff member of an academic institution you qualify for a free, full product license.\nFor more information, see:\n\n* https://www.gurobi.com/academia/academic-program-and-licenses/\n\nFor a commercial evaluation, you can\n[request an evaluation license](https://www.gurobi.com/free-trial/?utm_source=internal\u0026utm_medium=documentation\u0026utm_campaign=fy21_pipinstall_eval_pypipointer\u0026utm_content=c_na\u0026utm_term=pypi).\n\nOther useful resources to get started:\n* https://www.gurobi.com/documentation/\n* https://support.gurobi.com/hc/en-us/community/topics/\n\n# Development\nWe value any level of experience in using Gurobi Machine Learning and would like to encourage you to\ncontribute directly to this project. Please see the [Contributing Guide](CONTRIBUTING.md) for more information.\n\n## Source code\nYou can clone the latest sources with the command:\n```shell\ngit clone git@github.com:Gurobi/gurobi-machinelearning.git\n```\n\n## Testing\nAfter cloning the project, you can run the tests by invoking `tox`. For this, you will need to create a virtual\nenvironment and activate it:\n```shell\npython3.10 -m venv .venv\n. .venv/bin/activate\n```\nThen, you can install `tox` (\u003e= 3.26.0) and run a few basic tests:\n```shell\n(.venv) pip install tox\n(.venv) tox -e py310,pre-commit,docs\n```\n`tox` will install, among others, the aforementioned ML packages into a separate `venv`. These packages can be quite\nlarge, so this might take a while.\n\n### Running the full test set\nIn the above command, we only ran a subset of tests. Running the full set of tests requires having a Gurobi license\ninstalled, and is done by running just the `tox` command without the `-e` parameter:\n\n```shell\n(.venv) pip install tox\n(.venv) tox\n```\n\nIf you don't have a Gurobi license, you can still run the subset of tests, open a PR, and Github Actions will run the\ntests with a full Gurobi license.\n\n## Submitting a Pull Request\nBefore opening a Pull Request, have a look at the full [Contributing page](CONTRIBUTING.md) to make sure your code\ncomplies with our guidelines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgurobi%2Fgurobi-machinelearning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgurobi%2Fgurobi-machinelearning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgurobi%2Fgurobi-machinelearning/lists"}