OMLT icon indicating copy to clipboard operation
OMLT copied to clipboard

Support for sci-kit learn neural networks

Open jalving opened this issue 3 years ago • 5 comments

Is there interest in adding other readers in addition to ONNX? I have a working sci-kit learn neural network reader.

jalving avatar Oct 19 '21 20:10 jalving

At the moment with ONNX we can support keras, tensorflow, and pytorch. Scikit has an ONNX exporter but I'm not sure how it works with neural networks.

fracek avatar Oct 20 '21 08:10 fracek

@jalving do you still have interest in this? I saw there’s a package sklearn2onnx so I could work on building this out. Alternatively since the package exists we could just have the user do the conversion?

joshuahaddad avatar Feb 08 '22 22:02 joshuahaddad

I think we should at least test out the converter and make sure that onnx model imports into OMLT. I think we should also add links to the ONNX converters for various ML platforms. Once we do that, we should discuss a direct interface to sci-kt learn. It's another interface to support, but it might be worthwhile.

jalving avatar Feb 09 '22 23:02 jalving

I was curious so I messed around a bit with it today in between classes. I also wrote some code to convert sklearn scalers into OMLT scaling objects. It’s on my fork here https://github.com/joshuahaddad/OMLT/blob/sklearn-reader/src/omlt/io/sklearn-reader.py.

We should definitely talk about the specifics of the interface. I’d be interested in seeing some of the sklearn models Carl had if they’re not proprietary.

joshuahaddad avatar Feb 10 '22 00:02 joshuahaddad

This is pretty cool. Going through ONNX is a good way to support sklearn models. I have a sklearn model that is not proprietary. I will send it your way.

jalving avatar Feb 10 '22 23:02 jalving