1

I have some statistical & machine learning models written in Python using some of the standard Python libraries for such things (scikit-learn, pandas, numpy).

I have these wrapped and served by a web service in Python to expose the models via REST. For reasons, I now need to have these served by a Java web service using Spring Boot.

Initial plan was to cross-compile using Jython but after some reading it seems Jython does not support modules with C-extensions; which makes sense but sadly are fairly prevalent throughout some of these maths libs.

After some poking around, there doesn't seem to be really any good routes for executing these models directly in Java. I'm wondering if anyone has any knowledge that may help me here or has come across a similar problem previously.

I realize I can spawn a Python subprocess in the Java service to execute the models, but I'd rather find a cleaner / more performant route if possible.

Would like to make sure I'm not missing something here before I 'resort' to using subprocesses.

Apologies if I've not properly followed Stackoverflow conventions; I've tried.

Thanks

wrink
  • 11
  • 1
  • 1
    Have you looked at `jyni`? I suspect it won't do all you need but it's possibly your best bet – DavidW Apr 26 '19 at 20:12
  • @DavidW - Thanks very much for your response, unfortunately you were right and it wasn't a perfect fit. What I did end up doing was generating PMML sheets from the models and using JPMML for execution on the Java side – wrink May 21 '19 at 22:45

0 Answers0