简体   繁体   English

如何有效地使用Java的R预测模型?

[英]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.

相关问题 性能-如何有效地使用Java 8来提高性能? - performance - How can I efficiently use Java 8 to improve performance? 如何使用 Java 有效地解析 HTML? - How can I efficiently parse HTML with Java? 我怎样才能有效地使用StringBuilder? - How can I efficiently use StringBuilder? 在这种情况下,如何有效使用线程? - How can I efficiently use threads in this case? 如何从Java有效地将For-loop中的(700,000行)内容写入文件? - How can I efficiently write the (700,000 lines) content from a For-loop into a file efficiently from Java? 如何从MatLab导出经过训练的SVM模型以在Android(Java)中使用 - How can I export the trained SVM model from MatLab to use in Android(Java) 如何根据谓词有效地将对象从一个java集合转移到另一个集合? - How can I efficiently transfer objects from one java collection to an other according to a predicate? 从Web API返回的JSON可能是两倍还是很长,如何用Java最有效地处理呢? - JSON return from a web API can be double or long, how do I most efficiently deal with this in Java? 如何有效地从 HashMap 中获取与正则表达式/前缀匹配的所有字符串 [Java] - How can I efficiently get all Strings from a HashMap that match a regex/prefix [Java] 如何有效重构Java中的SQLite访问? - How can I efficiently refactor SQLite access in Java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM