PySCIPOpt-ML


NamePySCIPOpt-ML JSON
Version 1.1.1 PyPI version JSON
download
home_pageNone
Summaryautomatically formulate and embed ML models into MIPs with SCIP
upload_time2024-05-02 10:04: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/), and [Keras](https://keras.io/)

# 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/)

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`, `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 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}
}
```

            

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/0c/25/a1323a0f6fcb3d46370c66fdd7b078832a2802fdd3cf7fa724a202994592/pyscipopt_ml-1.1.1.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/), and [Keras](https://keras.io/)\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\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`, `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 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",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "automatically formulate and embed ML models into MIPs with SCIP",
    "version": "1.1.1",
    "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": "4594106fb20d146e6f71445b0998de93a25159828a7dbc8dfc7129c088b0f3b9",
                "md5": "75561b62452594fb2efc8173a90bcd25",
                "sha256": "464e24aaa72a70a602995715f39c63177cd55eb8b86880fe6066633aa59ab6de"
            },
            "downloads": -1,
            "filename": "PySCIPOpt_ML-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "75561b62452594fb2efc8173a90bcd25",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 70284,
            "upload_time": "2024-05-02T10:04:09",
            "upload_time_iso_8601": "2024-05-02T10:04:09.575657Z",
            "url": "https://files.pythonhosted.org/packages/45/94/106fb20d146e6f71445b0998de93a25159828a7dbc8dfc7129c088b0f3b9/PySCIPOpt_ML-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0c25a1323a0f6fcb3d46370c66fdd7b078832a2802fdd3cf7fa724a202994592",
                "md5": "b912aee8c9599bf30b50e844e59e922a",
                "sha256": "dad7aba00e0084a8e9c780c9c8bf6795cab26ac875f460be2f0f54a496083039"
            },
            "downloads": -1,
            "filename": "pyscipopt_ml-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b912aee8c9599bf30b50e844e59e922a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 69043,
            "upload_time": "2024-05-02T10:04:11",
            "upload_time_iso_8601": "2024-05-02T10:04:11.928363Z",
            "url": "https://files.pythonhosted.org/packages/0c/25/a1323a0f6fcb3d46370c66fdd7b078832a2802fdd3cf7fa724a202994592/pyscipopt_ml-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-02 10:04: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: 0.25436s