mlprodict
mlprodict explores ways to productionize machine learning predictions. One approach uses ONNX and tries to implement a runtime in python / numpy or wraps onnxruntime into a single class. The package provides tools to compare predictions, to benchmark models converted with sklearn-onnx. The second approach consists in converting a pipeline directly into C and is not much developed.
from sklearn.linear_model import LinearRegression
from sklearn.datasets import load_iris
from mlprodict.onnxrt import OnnxInference
from mlprodict.onnxrt.validate.validate_difference import (
measure_relative_difference)
import numpy
iris = load_iris()
X = iris.data[:, :2]
y = iris.target
lr = LinearRegression()
lr.fit(X, y)
# Predictions with scikit-learn.
expected = lr.predict(X[:5])
print(expected)
# Conversion into ONNX.
from mlprodict.onnx_conv import to_onnx
model_onnx = to_onnx(lr, X.astype(numpy.float32))
# Predictions with onnxruntime
oinf = OnnxInference(model_onnx, runtime='onnxruntime1')
ypred = oinf.run({'X': X[:5]})
print(ypred)
# Measuring the maximum difference.
print(measure_relative_difference(expected, ypred))
Installation
Installation from pip should work unless you need the latest development features.
pip install mlprodict
The package includes a runtime for onnx. That’s why there is a limited number of dependencies. However, some features relies on sklearn-onnx, onnxruntime, scikit-learn. They can be installed with the following instructions:
pip install mlprodict[all]
Some functions used in that package may rely on features implemented in PR still pending. In that case, you should install sklearn-onnx from:
pip install git+https://github.com/xadupre/sklearn-onnx.git@jenkins
If needed, the development version should be directy installed from github:
pip install git+https://github.com/sdpython/mlprodict.git
On Linux and Windows, the package must be compiled with openmp. Full instructions to build the module and run the documentation are described in config.yml for Linux. When this project becomes more stable, it will changed to be using official releases. The code is available at GitHub/mlprodict and has online documentation.
Metadata
Release files for mlprodict 0.6.1447
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 84.2 MB
Release files / mlprodict-0.6.1447-cp39-cp39-win_amd64.whl
| Download URL | mlprodict-0.6.1447-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
493ac8e6d7eeed55b8f024fa5b0abefe10418a8d3939b4b866a33bba6b04598f
|
|
BLAKE2b-256 checksum How to use checksums |
e96936b77656b3d234547abe4bfa1f6592bd2752579582358a9e050d647b890d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|
Release files / mlprodict-0.6.1447-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | mlprodict-0.6.1447-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 23.2 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e7173cd7a5a370f5f03fda689842b5f2954d7e77bdd55f9d9e70fbd379c76511
|
|
BLAKE2b-256 checksum How to use checksums |
16c47c0615edaaf955e45a56bdb15362dfc844aa2933e79a3fc977a931b95ce8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|
Release files / mlprodict-0.6.1447-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | mlprodict-0.6.1447-cp39-cp39-macosx_10_9_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.9 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
d774059dbfb37b12ac240fae7dc31ba90ef769648347f8b8aea0aec4358dac8d
|
|
BLAKE2b-256 checksum How to use checksums |
fcbf591276912dd277b41fc4faf8a125f66c51176c2ef7e8a1254e84f78c29c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|
Release files / mlprodict-0.6.1447-cp38-cp38-win_amd64.whl
| Download URL | mlprodict-0.6.1447-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
375449f944453df283966031e74939f0ed6f58dd69d86b185b82fd554b959c38
|
|
BLAKE2b-256 checksum How to use checksums |
e78b182ddf94bfeaef8495b4eb5abbe0f43c10b692ef1a4c65f2c71d339d9d52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|
Release files / mlprodict-0.6.1447-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | mlprodict-0.6.1447-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 23.4 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
3797b8570f9f74a686328dfded7614b9c1a0a0c1910ebbad9a484737a0828132
|
|
BLAKE2b-256 checksum How to use checksums |
d5d469c4f0f4b42cf1a6a01a5ce960b81555f95f2d2f492a20bb8ab5e71aa646
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|
Release files / mlprodict-0.6.1447-cp38-cp38-macosx_10_9_x86_64.whl
| Download URL | mlprodict-0.6.1447-cp38-cp38-macosx_10_9_x86_64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.8 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
e57065f5c0041b0ba8775dd24e6ce9e9bc53c82af0b90d5f0c95ef0da0d1ca47
|
|
BLAKE2b-256 checksum How to use checksums |
edd64c26f98df6150769e63bd81ed0897f31a49816a8c6268d80426ca94e187c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|
Release files / mlprodict-0.6.1447-cp37-cp37m-win_amd64.whl
| Download URL | mlprodict-0.6.1447-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
94508f87ac94ae9d38e7234cc07082810a9f0731411c01ee2b164da98a775901
|
|
BLAKE2b-256 checksum How to use checksums |
73af986c64b04386d9983d27385b23ee4b5da1e622149fd6c51d70acbe570ea7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|
Release files / mlprodict-0.6.1447-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | mlprodict-0.6.1447-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 24.2 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e3934b5c9e898222467ce54a16cd91116fb0315363cb202df44af05102b2f164
|
|
BLAKE2b-256 checksum How to use checksums |
4fc4f9247f10256cf66363b273c0ec21d15221d99bc352de1c13296738abffda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|
Release files / mlprodict-0.6.1447-cp37-cp37m-macosx_10_9_x86_64.whl
| Download URL | mlprodict-0.6.1447-cp37-cp37m-macosx_10_9_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
abbe54d11bc3148670d08cef7213a30d3a23804836882d7b57736764a1a478b4
|
|
BLAKE2b-256 checksum How to use checksums |
9e5da778445208ffc2bfe3c9bab7b4e2b6f059cc443b44a0fd5a2f738b843286
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
|
Security for mlprodict 0.6.1447
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.