1
$\begingroup$

I'm currently working on a project where we're building a data pipeline. We have spark setup and have generated models. Sadly, loading the model in Spark and querying it isn't fast enough for us. What's the most straightforward way of exporting a model and loading it into memory on a local server? I've researched PMML and some libraries and that appears to be one path.

$\endgroup$
  • $\begingroup$ Welcome to DataScience.SE! What software exactly do you want to be running on your local server to read the model? $\endgroup$ – Emre Jul 27 '16 at 17:52
  • $\begingroup$ @Emre, Thanks for the welcome. I have a "decision" server written in pure Java that I'd like to load the model into and query. I'm not opposed to using any libraries, so long as the model can be loaded by and run in the JVM. $\endgroup$ – dmux Jul 27 '16 at 18:23
  • $\begingroup$ Obviously you need a machine learning library that can read your model parameters. I have no practical experience with them, but there's a good chance DL4J and maybe H2O will do what you want. What kind of machine learning models are you considering? $\endgroup$ – Emre Jul 27 '16 at 18:35
  • $\begingroup$ If I may ask, what do you mean by "exporting a model and loading it". How do you actually perform your export ? $\endgroup$ – eliasah Aug 1 '16 at 8:42
  • $\begingroup$ @eliasah, It may be that my understanding of how machine learning models work. From working with the data-scientist on our team, I've come under the impression that once a model is trained, you can export that model to a framework-independent format. Am I incorrect in thinking that a model can be thought of as a mathematical function? (Takes an input to its predict method, returns output.) If training the model is simply refining a mathematical function, what prevents that function from being evaluated in a different language? $\endgroup$ – dmux Aug 2 '16 at 14:28
1
$\begingroup$

If PMML supports the model you're trying to express, it's probably the best option. Spark has some partial support for exporting as PMML. Look into JPMML + OpenScoring to score the PMML in an embedded instance.

There are loads of tools in this space that implement something like this, but they're typically entwined with their own formats or model management system.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.