[英]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? 我有一些我在R中开发的分类模型,其功能包括glm,rpart等。从Java调用这些模型的计算效率最高的方法是什么? I've seen JRI, but that looks like there are lots of text-based calls to R.
我见过JRI,但看起来有很多基于文本的调用R.
Is there a way to use these models from Java with low overhead? 有没有办法从Java中使用这些模型,开销较低?
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现在有一个功能测试模块,专门处理使用R / Rattle开发的PMML模型评分: 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. JPMML应该能够毫无问题地对决策树(即.rpart()函数)和神经网络(即.net()函数)进行评分。 The support for generalized regression models (ie. glm() function) is coming soon.
对广义回归模型(即glm()函数)的支持即将推出。
in the Case of GLMs you can translate them to pure Java language with the glm.deploy package 在GLM的情况下,您可以使用glm.deploy包将它们转换为纯Java语言
https://cran.r-project.org/web/packages/glm.deploy/index.html https://cran.r-project.org/web/packages/glm.deploy/index.html
Do you think it is too slow to export them with the pmml package and then use a java based pmml reader like jpmml or Zementis? 你认为使用pmml包导出它们然后使用基于java的pmml阅读器(如jpmml或Zementis)太慢了吗? http://code.google.com/p/jpmml/
http://code.google.com/p/jpmml/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.