PySCIPOpt-ML


NamePySCIPOpt-ML JSON
Version 1.3.0 PyPI version JSON
download
home_pageNone
Summaryautomatically formulate and embed ML models into MIPs with SCIP
upload_time2024-09-05 10:49:11
maintainerNone
docs_urlNone
authorMark Turner - Zuse Institute Berlin
requires_python>=3.8
licenseApache-2.0
keywords mixed-integer programming scip scikit-learn pytorch xgboost lightgbm keras ml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Python versions](https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10%20|%203.11%20|%203.12-blue)
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![PyPI](https://img.shields.io/pypi/v/pyscipopt-ml)](https://pypi.org/project/pyscipopt-ml)

![](docs/_static/pyscipopt-ml-figure.png)

# PySCIPOpt-ML

PySCIPOpt-ML is a python interface to automatically formulate Machine Learning (ML) models into Mixed-Integer Programs (MIPs).
PySCIPOPT-ML allows users to easily optimise MIPs with embedded ML constraints.

The package currently supports various ML objects from [Scikit-Learn](https://scikit-learn.org/stable/),
[XGBoost](https://xgboost.readthedocs.io/en/stable/), [LightGBM](https://lightgbm.readthedocs.io/en/stable/),
[PyTorch](https://pytorch.org/), [Keras](https://keras.io/), and [ONNX](https://onnx.ai/).

# Documentation

The latest user manual is available on [readthedocs](https://pyscipopt-ml.readthedocs.io/).

# Contact us

For reporting bugs, issues and feature requests please
[open an issue](https://github.com/Opt-Mucca/PySCIPOpt-ML/issues).

# Installation

## Dependencies

`pyscipopt-ml` requires the following:
- Python >= 3.8
- [`numpy`](https://pypi.org/project/numpy/) >= 1.23.0
- [`pyscipopt`](https://pypi.org/project/pyscipopt/) >= 4.4.0

The current version supports the following ML packages:
- [`torch`](https://pypi.org/project/torch/)
- [`keras`](https://pypi.org/project/tensorflow/)
- [`scikit-learn`](https://pypi.org/project/scikit-learn)
- [`XGBoost`](https://pypi.org/project/xgboost/)
- [`LightGBM`](https://pypi.org/project/lightgbm/)
- [`onnx`](https://pypi.org/project/onnx/)

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

## Pip installation

The easiest way to install `PySCIPOpt-ML` is using `pip`.
It is recommended to always install packages in a virtual environment:
```shell
(venv) pip install pyscipopt-ml
```
This will also install the `numpy` and `pyscipopt` dependencies.

## Installation from source

An alternative way to install `PySCIPOpt-ML` is from source. First this repository
needs to be cloned. This can be achieved via HTTPS with:
```shell
git clone https://github.com/Opt-Mucca/PySCIPOpt-ML/
```
and SHH with
```shell
git clone git@github.com:Opt-Mucca/PySCIPOpt-ML.git
```

After cloning the repository entering the directory where it was cloned, one can run the command:
```shell
(venv) python -m pip install .
```

# Development
This project is completely open to any contributions. Feel free to implement your own functionalities.

Before committing anything, please install pytest, pre-commit, and all ML frameworks:

```shell
pip install pytest
pip install scikit-learn
pip install torch
pip install tensorflow
pip install xgboost
pip install lightgbm
pip install onnx
pip install onnxruntime
pip install pre-commit
pre-commit install
```

## Source code
You can clone the latest sources with the command:
```shell
git clone git@github.com:Opt-Mucca/PySCIPOpt-ML.git
```

## Documentation
You can build the documentation locally with the command
```shell
pip install -r docs/requirements.txt
sphinx-build docs docs/_build
```
Às the documentation requires additional python packages, one should run the following command
before building the documentation for the first time:
```shell
(venv) pip install -r docs/requirements.txt
```

## Testing
After cloning the project, you can run the tests by invoking `pytest`. For this, you will need to create a virtual
environment and activate it. Please also make sure to append your python path:
```shell
python -m venv venv
source venv/bin/activate
export PYTHONPATH="$(pwd):${PYTHONPATH}"
```
Then, you can install `pytest` and run a few basic tests:
```shell
(venv) pip install pytest
(venv) pytest
```

## How to cite this work

If this software was used for academic purposes, please cite our paper with the below information:

```
@article{turner2023pyscipopt,
  title={PySCIPOpt-ML: Embedding Trained Machine Learning Models into Mixed-Integer Programs},
  author={Turner, Mark and Chmiela, Antonia and Koch, Thorsten and Winkler, Michael},
  journal={arXiv preprint arXiv:2312.08074},
  year={2023}
}
```

## Funding Acknowledgements

The work for this article has been conducted in the Research Campus MODAL
funded by the German Federal Ministry of Education and Research (BMBF)
(fund numbers 05M14ZAM, 05M20ZBM).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "PySCIPOpt-ML",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "mixed-integer programming, SCIP, scikit-learn, pytorch, xgboost, lightgbm, keras, ml",
    "author": "Mark Turner - Zuse Institute Berlin",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/de/19/cd60fa8f68bfdfae00fb5a58d93cb5eda44db2977fa30cb413b386ce8b93/pyscipopt_ml-1.3.0.tar.gz",
    "platform": null,
    "description": "![Python versions](https://img.shields.io/badge/python-3.8%20|%203.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/pyscipopt-ml)](https://pypi.org/project/pyscipopt-ml)\n\n![](docs/_static/pyscipopt-ml-figure.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# 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 >= 3.8\n- [`numpy`](https://pypi.org/project/numpy/) >= 1.23.0\n- [`pyscipopt`](https://pypi.org/project/pyscipopt/) >= 4.4.0\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\u00c0s 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@article{turner2023pyscipopt,\n  title={PySCIPOpt-ML: Embedding Trained Machine Learning Models into Mixed-Integer Programs},\n  author={Turner, Mark and Chmiela, Antonia and Koch, Thorsten and Winkler, Michael},\n  journal={arXiv preprint arXiv:2312.08074},\n  year={2023}\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",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "automatically formulate and embed ML models into MIPs with SCIP",
    "version": "1.3.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/Opt-Mucca/PySCIPOpt-ML/issues",
        "Documentation": "https://pyscipopt-ml.readthedocs.io/en/stable/",
        "Repository": "https://github.com/Opt-Mucca/PySCIPOpt-ML"
    },
    "split_keywords": [
        "mixed-integer programming",
        " scip",
        " scikit-learn",
        " pytorch",
        " xgboost",
        " lightgbm",
        " keras",
        " ml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "65890339fe8ebb1ac282d4bf0fdd1f3bc7cc801efea02ea5d0460d9a87a74069",
                "md5": "f213e509f1f42fdd5d497544923f07fb",
                "sha256": "2daf5144944e50db7604b6c74aaaf387dcc979feef04e2899982f4f6fde89fd6"
            },
            "downloads": -1,
            "filename": "PySCIPOpt_ML-1.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f213e509f1f42fdd5d497544923f07fb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 77665,
            "upload_time": "2024-09-05T10:48:54",
            "upload_time_iso_8601": "2024-09-05T10:48:54.649013Z",
            "url": "https://files.pythonhosted.org/packages/65/89/0339fe8ebb1ac282d4bf0fdd1f3bc7cc801efea02ea5d0460d9a87a74069/PySCIPOpt_ML-1.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "de19cd60fa8f68bfdfae00fb5a58d93cb5eda44db2977fa30cb413b386ce8b93",
                "md5": "c38dcc1485ee83251c9c497fda3da58a",
                "sha256": "84459540f20793df1d40831fce6a7eeb4b0eee3c53424c7baacb323ecf4d0794"
            },
            "downloads": -1,
            "filename": "pyscipopt_ml-1.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c38dcc1485ee83251c9c497fda3da58a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 75716,
            "upload_time": "2024-09-05T10:49:11",
            "upload_time_iso_8601": "2024-09-05T10:49:11.829903Z",
            "url": "https://files.pythonhosted.org/packages/de/19/cd60fa8f68bfdfae00fb5a58d93cb5eda44db2977fa30cb413b386ce8b93/pyscipopt_ml-1.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-05 10:49:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Opt-Mucca",
    "github_project": "PySCIPOpt-ML",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyscipopt-ml"
}
        
Elapsed time: 3.82552s