问题
I want to use machine learning algorithms in java. Mahout with hadoop is too slow and weka is not able to work because of large datasize. So is it possible to call H2O library from Java or any other better option available for java?
回答1:
What you can do is implement your machine learning algorithms in R, and then call them via command line calls to the underlying system. I found this to be my best option when doing my thesis in Bioinformatics a few years ago.
I remember trying to call the R engine directly from Java using some kind of Java/R integration-library, but decided it was too slow and cumbersome, so I ended up instead writing simple scripts in R, which Java could call via the command line interface.
The downside of this is that slow processes may be hard to track; you might not get any result from an R-operation until it has completed and returned it's status code.
You'll need to write some Java code to issue the R commands, and wait for the response/result from the process, preferably without locking your Java application completely (separate threads, or a background process).
回答2:
Yes you can. Please see the instructions on the H2O Flow UI pressing the POJO button after Building and Viewing a model. It gives you detailed instructions about how to download your generated model as a java file (POJO) and about how to download the h20 jar file needed to run it. You can get the same instructions pressing the Preview POJO button.
来源:https://stackoverflow.com/questions/33909907/can-i-use-directly-h2o-library-functions-from-java-or-the-only-option-for-h2o-is