Java examples for scoring
Many users can only use Java in a production environment. It would be nice if we can provide an example project for scoring in Java. I saw some Java interfaces at https://github.com/combust/mleap/tree/master/mleap-runtime/src/main/java/ml/combust/mleap/runtime/javadsl. But no public doc/example mentioned them.
Hey @mengxr,
We'll work to add some examples in the doc, but for now, you can check out this toy project that shows how to use mleap-runtime within a spring boot Java service: https://github.com/ancasarb/mleap-scoring-spring-boot
We're also working on some grpc and springboot scoring services in this branch that we'd like to merge soon: https://github.com/combust/mleap/tree/feature/mleap-grpc
Let me know if you have any questions!
Amazon SageMaker has also developed a fully Java based serving setup powered by mleap-runtime. You can find the code here - https://github.com/aws/sagemaker-sparkml-serving-container.
MLeap provided Java interface is nice and it didn't require us to write any Scala code (barring the use of JavaConverters from Scala library) while developing this.
@ancasarb I am not able to access any of the links which you have added. (Unfortunate 404 errors). I am also looking for mleap java prediction/scoring examples.
hey @jainakshay2605, sorry about that, I'm not too sure what happened to that project. You can also take a look at the unit tests in JavaDSLSpec.java which shows you how you can do various things from creating a leap frame, tensor types, row transformers, transform a leap frame etc. The most comprehensive test is this one https://github.com/combust/mleap/blob/master/mleap-runtime/src/test/scala/ml/combust/mleap/runtime/javadsl/JavaDSLSpec.java#L143, which saves a bundle to a file, loads it back in and then transformers a leap frame with the loaded bundle.
Hi @jainakshay2605 you can take a look at an example here how MLeap can be used from Java - https://github.com/aws/sagemaker-sparkml-serving-container. I used the repository of @ancasarb as an example for writing this.
I found the MLeap serving doc (http://mleap-docs.combust.ml/mleap-serving/) really helpful for scoring. the page doesn't talk about how to call via Java. but there are pages on the website that talk about how to construct the input leapframe
Just curious if there was any update on this topic of having Java examples in the documentation. Thanks.