教程

本教程从一个简单的示例开始,将管道转换为更复杂的示例,涉及 ONNX 操作符ONNX ML 操作符 中实际上未实现的操作符。

本教程使用以下版本进行测试

<<<

import catboost
import numpy
import scipy
import sklearn
import lightgbm
import onnx
import onnxmltools
import onnxruntime
import xgboost
import skl2onnx

mods = [
    numpy,
    scipy,
    sklearn,
    lightgbm,
    xgboost,
    catboost,
    onnx,
    onnxmltools,
    onnxruntime,
    skl2onnx,
]
mods = [(m.__name__, m.__version__) for m in mods]
mx = max(len(_[0]) for _ in mods) + 1
for name, vers in sorted(mods):
    print("%s%s%s" % (name, " " * (mx - len(name)), vers))

>>>

    <frozen importlib._bootstrap>:241: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 232 from PyObject
    catboost    1.2.2
    lightgbm    4.2.0
    numpy       1.26.4
    onnx        1.17.0
    onnxmltools 1.13.0
    onnxruntime 1.18.0+cu118
    scipy       1.13.0
    skl2onnx    1.18.0
    sklearn     1.6.dev0
    xgboost     2.0.3