Name | ebm2onnx JSON |
Version |
3.3.0
JSON |
| download |
home_page | None |
Summary | EBM model serialization to ONNX |
upload_time | 2024-11-05 17:11:20 |
maintainer | None |
docs_url | None |
author | Romain Picard |
requires_python | >=3.6 |
license | MIT License Copyright (c) 2021, SoftAtHome Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
ebm2onnx
interpretml
machine-learning
onnx
|
VCS |
|
bugtrack_url |
|
requirements |
onnx
interpret-core
numpy
|
Travis-CI |
No Travis.
|
coveralls test coverage |
|
========
Ebm2onnx
========
.. image:: https://img.shields.io/pypi/v/ebm2onnx.svg
:target: https://pypi.python.org/pypi/ebm2onnx
.. image:: https://github.com/interpretml/ebm2onnx/actions/workflows/ci.yml/badge.svg
:target: https://github.com/interpretml/ebm2onnx/actions/workflows/ci.yml
:alt: CI
.. image:: https://coveralls.io/repos/github/interpretml/ebm2onnx/badge.svg?branch=master
:target: https://coveralls.io/github/interpretml/ebm2onnx?branch=master
:alt: Code Coverage
.. image:: https://readthedocs.org/projects/ebm2onnx/badge/?version=latest
:target: https://ebm2onnx.readthedocs.io/en/latest/?version=latest
:alt: Documentation Status
.. image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/interpretml/ebm2onnx/master?filepath=examples%2Fconvert.ipynb
Ebm2onnx converts `EBM <https://github.com/interpretml/interpret>`_ models to
ONNX. It allows to run an EBM model on any ONNX compliant runtime.
Features
--------
* Binary classification
* Regression
* Continuous, nominal, and ordinal variables
* N-way interactions
* Multi-class classification (support is still experimental in EBM)
* Expose predictions probabilities
* Expose local explanations
* Export a model as part of a scikit-learn pipeline (experimental)
The export of the models is tested against `ONNX Runtime <https://github.com/Microsoft/onnxruntime>`_.
Get Started
------------
Train an EBM model:
.. code:: python
# prepare dataset
df = pd.read_csv('titanic_train.csv')
df = df.dropna()
feature_columns = ['Age', 'Fare', 'Pclass', 'Embarked']
label_column = "Survived"
y = df[[label_column]]
le = LabelEncoder()
y_enc = le.fit_transform(y)
x = df[feature_columns]
x_train, x_test, y_train, y_test = train_test_split(x, y_enc)
# train an EBM model
model = ExplainableBoostingClassifier(
feature_types=['continuous', 'continuous', 'continuous', 'nominal'],
)
model.fit(x_train, y_train)
Then you can convert it to ONNX in a single function call:
.. code:: python
import onnx
import ebm2onnx
onnx_model = ebm2onnx.to_onnx(
model,
ebm2onnx.get_dtype_from_pandas(x_train),
)
onnx.save_model(onnx_model, 'ebm_model.onnx')
If your dataset is not a pandas dataframe, you can provide the features' types
directly:
.. code:: python
import ebm2onnx
onnx_model = ebm2onnx.to_onnx(
model,
dtype={
'Age': 'double',
'Fare': 'double',
'Pclass': 'int',
'Embarked': 'str',
}
)
onnx.save_model(onnx_model, 'ebm_model.onnx')
Try it live
-------------
- You can live test the `model conversion <https://mybinder.org/v2/gh/interpretml/ebm2onnx/master?filepath=examples%2Fconvert.ipynb>`_.
- You can live test `local explanations <https://mybinder.org/v2/gh/interpretml/ebm2onnx/master?filepath=examples%2Fexplain_local.ipynb>`_.
- You can live test the export of a `scikit-learn pipeline <https://mybinder.org/v2/gh/interpretml/ebm2onnx/master?filepath=examples%2Fsklearn-pipeline.ipynb>`_.
Supporting organizations
-------------------------
The following organizations are supporting Ebm2onnx:
- `SoftAtHome <https://www.softathome.com>`_: Main supporter of Ebm2onnx development.
- `InterpretML <https://interpret.ml>`_: Ebm2onnx is hosted under the umbrella of the InterpretML organization.
|img_sah| |img_interpret|
.. |img_sah| image:: https://raw.githubusercontent.com/interpretml/ebm2onnx/master/assets/sah_logo.png
:target: https://www.softathome.com
.. |img_interpret| image:: https://raw.githubusercontent.com/interpretml/ebm2onnx/master/assets/interpretml-logo.png
:target: https://interpret.ml
Raw data
{
"_id": null,
"home_page": null,
"name": "ebm2onnx",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "ebm2onnx, interpretml, machine-learning, onnx",
"author": "Romain Picard",
"author_email": "romain.picard@softathome.com",
"download_url": "https://files.pythonhosted.org/packages/74/ed/1a0e19a0a92ff948927f111aa584597d86c4a912360664c9d6f347016a9e/ebm2onnx-3.3.0.tar.gz",
"platform": null,
"description": "========\nEbm2onnx\n========\n\n\n.. image:: https://img.shields.io/pypi/v/ebm2onnx.svg\n :target: https://pypi.python.org/pypi/ebm2onnx\n\n.. image:: https://github.com/interpretml/ebm2onnx/actions/workflows/ci.yml/badge.svg\n :target: https://github.com/interpretml/ebm2onnx/actions/workflows/ci.yml\n :alt: CI\n\n.. image:: https://coveralls.io/repos/github/interpretml/ebm2onnx/badge.svg?branch=master\n :target: https://coveralls.io/github/interpretml/ebm2onnx?branch=master\n :alt: Code Coverage\n\n.. image:: https://readthedocs.org/projects/ebm2onnx/badge/?version=latest\n :target: https://ebm2onnx.readthedocs.io/en/latest/?version=latest\n :alt: Documentation Status\n\n.. image:: https://mybinder.org/badge_logo.svg\n :target: https://mybinder.org/v2/gh/interpretml/ebm2onnx/master?filepath=examples%2Fconvert.ipynb\n\n\nEbm2onnx converts `EBM <https://github.com/interpretml/interpret>`_ models to\nONNX. It allows to run an EBM model on any ONNX compliant runtime.\n\n\nFeatures\n--------\n\n* Binary classification\n* Regression\n* Continuous, nominal, and ordinal variables\n* N-way interactions\n* Multi-class classification (support is still experimental in EBM)\n* Expose predictions probabilities\n* Expose local explanations\n* Export a model as part of a scikit-learn pipeline (experimental)\n\nThe export of the models is tested against `ONNX Runtime <https://github.com/Microsoft/onnxruntime>`_. \n\nGet Started\n------------\n\nTrain an EBM model:\n\n.. code:: python\n\n # prepare dataset\n df = pd.read_csv('titanic_train.csv')\n df = df.dropna()\n\n feature_columns = ['Age', 'Fare', 'Pclass', 'Embarked']\n label_column = \"Survived\"\n y = df[[label_column]]\n le = LabelEncoder()\n y_enc = le.fit_transform(y)\n x = df[feature_columns]\n x_train, x_test, y_train, y_test = train_test_split(x, y_enc)\n\n # train an EBM model\n model = ExplainableBoostingClassifier(\n feature_types=['continuous', 'continuous', 'continuous', 'nominal'],\n )\n model.fit(x_train, y_train)\n\n\nThen you can convert it to ONNX in a single function call:\n\n.. code:: python\n\n import onnx\n import ebm2onnx\n\n onnx_model = ebm2onnx.to_onnx(\n model,\n ebm2onnx.get_dtype_from_pandas(x_train),\n )\n onnx.save_model(onnx_model, 'ebm_model.onnx')\n\n\nIf your dataset is not a pandas dataframe, you can provide the features' types\ndirectly:\n\n.. code:: python\n\n import ebm2onnx\n\n onnx_model = ebm2onnx.to_onnx(\n model,\n dtype={\n 'Age': 'double',\n 'Fare': 'double',\n 'Pclass': 'int',\n 'Embarked': 'str',\n }\n )\n onnx.save_model(onnx_model, 'ebm_model.onnx')\n\n\nTry it live\n-------------\n\n- You can live test the `model conversion <https://mybinder.org/v2/gh/interpretml/ebm2onnx/master?filepath=examples%2Fconvert.ipynb>`_.\n- You can live test `local explanations <https://mybinder.org/v2/gh/interpretml/ebm2onnx/master?filepath=examples%2Fexplain_local.ipynb>`_.\n- You can live test the export of a `scikit-learn pipeline <https://mybinder.org/v2/gh/interpretml/ebm2onnx/master?filepath=examples%2Fsklearn-pipeline.ipynb>`_.\n\n\nSupporting organizations\n-------------------------\n\nThe following organizations are supporting Ebm2onnx:\n\n- `SoftAtHome <https://www.softathome.com>`_: Main supporter of Ebm2onnx development.\n- `InterpretML <https://interpret.ml>`_: Ebm2onnx is hosted under the umbrella of the InterpretML organization.\n\n|img_sah| |img_interpret|\n\n.. |img_sah| image:: https://raw.githubusercontent.com/interpretml/ebm2onnx/master/assets/sah_logo.png\n :target: https://www.softathome.com\n\n.. |img_interpret| image:: https://raw.githubusercontent.com/interpretml/ebm2onnx/master/assets/interpretml-logo.png\n :target: https://interpret.ml\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2021, SoftAtHome Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "EBM model serialization to ONNX",
"version": "3.3.0",
"project_urls": {
"repository": "https://github.com/interpretml/ebm2onnx.git"
},
"split_keywords": [
"ebm2onnx",
" interpretml",
" machine-learning",
" onnx"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "74ed1a0e19a0a92ff948927f111aa584597d86c4a912360664c9d6f347016a9e",
"md5": "bab8d25198f7e0a2f4eed67fa38bcaa5",
"sha256": "bc3ed52f49a2ccc9a0f8e39a03315aa7b55773f22c9dd724bdcbf7cc38618a27"
},
"downloads": -1,
"filename": "ebm2onnx-3.3.0.tar.gz",
"has_sig": false,
"md5_digest": "bab8d25198f7e0a2f4eed67fa38bcaa5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 20047,
"upload_time": "2024-11-05T17:11:20",
"upload_time_iso_8601": "2024-11-05T17:11:20.071412Z",
"url": "https://files.pythonhosted.org/packages/74/ed/1a0e19a0a92ff948927f111aa584597d86c4a912360664c9d6f347016a9e/ebm2onnx-3.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-05 17:11:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "interpretml",
"github_project": "ebm2onnx",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "onnx",
"specs": [
[
"~=",
"1.8"
]
]
},
{
"name": "interpret-core",
"specs": [
[
"~=",
"0.3"
]
]
},
{
"name": "numpy",
"specs": [
[
"~=",
"1.19"
]
]
}
],
"lcname": "ebm2onnx"
}