Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

build and test build wheel Python versions Black PyPI Documentation Status Gurobi-forum

Gurobi

Gurobi Machine Learning

Gurobi Machine Learning is an open-source python package to formulate trained regression models in a gurobipy model to be solved with the Gurobi solver.

The package currently supports various scikit-learn objects. It has limited support for Keras, PyTorch and XGBoost. Only neural networks with ReLU activation can be used with Keras and PyTorch.

Documentation

The latest user manual is available on readthedocs.

Contact us

For questions related to using Gurobi Machine Learning please use Gurobi's Forum.

For reporting bugs, issues and feature requests please open an issue.

If you encounter issues with Gurobi or gurobipy please contact Gurobi Support.

Installation

Dependencies

gurobi-machinelearning requires the following:

The current version supports the following ML packages:

Installing these packages is only required if the predictor you want to insert uses them (i.e. to insert a Keras based predictor you need to have tensorflow installed).

The up to date supported and tested versions of each package for the last release can be found in the documentation.

Pip installation

The easiest way to install gurobi-machinelearning is using pip in a virtual environment:

(.venv) pip install gurobi-machinelearning

This will also install the numpy, scipy and gurobipy dependencies.

Please note that gurobipy is commercial software and requires a license. When installed via pip or conda, gurobipy ships with a free license which is only for testing and can only solve models of limited size.

Getting a Gurobi License

Alternatively to the bundled limited license, there are licenses that can handle models of all sizes.

As a student or staff member of an academic institution you qualify for a free, full product license. For more information, see:

For a commercial evaluation, you can request an evaluation license.

Other useful resources to get started:

Development

We value any level of experience in using Gurobi Machine Learning and would like to encourage you to contribute directly to this project. Please see the Contributing Guide for more information.

Source code

You can clone the latest sources with the command:

git clone git@github.com:Gurobi/gurobi-machinelearning.git

Testing

After cloning the project, you can run the tests by invoking tox. For this, you will need to create a virtual environment and activate it:

python3.10 -m venv .venv
. .venv/bin/activate

Then, you can install tox (>= 3.26.0) and run a few basic tests:

(.venv) pip install tox
(.venv) tox -e py311,pre-commit,docs

tox will install, among others, the aforementioned ML packages into a separate venv. These packages can be quite large, so this might take a while.

Running the full test set

In the above command, we only ran a subset of tests. Running the full set of tests requires having a Gurobi license installed, and is done by running just the tox command without the -e parameter:

(.venv) pip install tox
(.venv) tox

If you don't have a Gurobi license, you can still run the subset of tests, open a PR, and Github Actions will run the tests with a full Gurobi license.

Submitting a Pull Request

Before opening a Pull Request, have a look at the full Contributing page to make sure your code complies with our guidelines.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gurobi_machinelearning-1.7.0a1.tar.gz (47.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gurobi_machinelearning-1.7.0a1-py3-none-any.whl (82.5 kB view details)

Uploaded Python 3

File details

Details for the file gurobi_machinelearning-1.7.0a1.tar.gz.

File metadata

  • Download URL: gurobi_machinelearning-1.7.0a1.tar.gz
  • Upload date:
  • Size: 47.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for gurobi_machinelearning-1.7.0a1.tar.gz
Algorithm Hash digest
SHA256 5ab0186c13fff4c2d1af9cee1c95c91a424a812cfb3b66966c18f7f13edf41de
MD5 fcfb7c6709a0fadc3d13fe30a47bab43
BLAKE2b-256 6c7dd8febc116ea59d2f1d2fe86a63e4dab86c014ed45db19b69ad44915d3eb7

See more details on using hashes here.

File details

Details for the file gurobi_machinelearning-1.7.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for gurobi_machinelearning-1.7.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 5eed8b7ccfb7081bb2fb9b7bf28180301989f94d3968f70437d23ac76b0a2290
MD5 e1892b51870362f8ac5fae270e629849
BLAKE2b-256 086f800be916d112d1a4f96f4ba111cd3862517b42c57e352cee3a5eb8e45300

See more details on using hashes here.

Release history Release notifications | RSS feed

1.7.0

2 files

This release

1.7.0a1 This release

2 files

1.6.0

2 files

1.5.6

2 files

1.5.5

2 files

1.5.4

2 files

1.5.3

2 files

1.5.2

2 files

1.5.1

2 files

1.5.0.post1

2 files

1.5.0

2 files

1.4.1

2 files

1.4.0

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page