scikit-tree icon indicating copy to clipboard operation
scikit-tree copied to clipboard

ONNX support

Open ogencoglu opened this issue 10 months ago • 4 comments
trafficstars

Does treeple support ONNX export? It would be great as ONNX is the common format for all sorts of models and can be deployed to any environment (e.g. scikit-learn, lightgbm, xgboost etc all support ONNX export).

ogencoglu avatar Jan 09 '25 16:01 ogencoglu

No ONNX is not supported yet, but the package supports pickling in the same way scikit-learn does. I'm not familiar with how to get ONNX support working.

Are there any technical features required for that?

adam2392 avatar Jan 10 '25 15:01 adam2392

Thanks for the reply. skl2onnx library supports a lot of base models from scikit-learn. If treeple models can use similar classes, it should be straightforward.

Note that ONNX is quite different than pickling. It is safe, it provides inference optimizations, it is framework, programming language or environment agnostic.

ogencoglu avatar Jan 10 '25 18:01 ogencoglu

Just to understand a bit better, what is your use-case for using ONNX instead of the actual pickled model?

Would you be interested in exploring how to get treeple models working with ONNX?

adam2392 avatar Jan 10 '25 19:01 adam2392

Because pickle is a python-specific format and one can not serve pickle in frontend (Typescript or javascript) or embed in some C++ application etc.

I may have a look during spring if I have time.

ogencoglu avatar Jan 10 '25 21:01 ogencoglu