Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I efficiently use an R prediction model from Java?

I have some classification models that I've developed in R with functions like glm, rpart, etc. What's the most computationally efficient way to call those models from Java? I've seen JRI, but that looks like there are lots of text-based calls to R.

Is there a way to use these models from Java with low overhead?

like image 801
Thomas Johnson Avatar asked Feb 29 '12 12:02

Thomas Johnson


1 Answers

JPMML now has a functional testing module that specifically deals with scoring PMML models that have been developed using R/Rattle: https://github.com/jpmml/jpmml/tree/master/pmml-rattle

JPMML should be able to score decision trees (ie. rpart() function) and neural networks (ie. nnet() function) without problem. The support for generalized regression models (ie. glm() function) is coming soon.

like image 146
user1808924 Avatar answered Nov 15 '22 10:11

user1808924