This is my first time using H2O :-)
Goal:
I'm trying to integrate the prediction model on a standalone server in the simplest way possible:
I want to make a prediction based on some parameters.
What I have tried:
- I have already created the model in H2O and it's been trained on historical data.
- I have exported the model into a .java file (is this the POJO?)
- I have tried to follow the instructions included to compile it (something like "javac -cp h2o-genmodel.jar -J-Xmx2g -J-XX:MaxPermSize=128m Model_1.java", which outputs a bunch of .class files)
- I have tried to execute the POJO to get a prediction (something like this walk-trough: http://h2o-release.s3.amazonaws.com/h2o/rel-markov/1/docs-website/userguide/scorePOJO.html)
My questions:
- POJO is which type of file (source code, plain text, archive, executable, other)?
- Which java version is required?
- Do i need the same java version to create the model in H2O, compile it and run it, or it can be different versions?
- Do I need to compile the POJO on the same server that it needs to be executed on?
- How do I simply query a POJO for a prediction?
- Do I need anything else than Java Runtime Environment (JRE) on the server to query a POJO for a prediction?
I feel the documentation on H2O is missing a very simple tutorial for simply doing standalone prediction queries on a H2O model. I do not use Hadoop or Spark and I would like to install as little as possible on the server that will calculate predictions in real time.
Best,
Jakob
IMPORTANT: This email message is intended only for the use of the individual to whom, or entity to which, it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are NOT the intended recipient, you are hereby notified that any use, dissemination, distribution or copying of the communication is strictly prohibited. If you have received this communication in error, please notify me immediately. Thank you.
My questions:
- POJO is which type of file (source code, plain text, archive, executable, other)?
- Which java version is required?
- Do i need the same java version to create the model in H2O, compile it and run it, or it can be different versions?
- Do I need to compile the POJO on the same server that it needs to be executed on?
- How do I simply query a POJO for a prediction?
hex.genmodel.GenModel rawModel;
rawModel = (hex.genmodel.GenModel) Class.forName(modelClassName).newInstance();
EasyPredictModelWrapper model = new EasyPredictModelWrapper(rawModel);
RowData row = new RowData();
row.put("Year", "1987");
row.put("Month", "10");
row.put("DayofMonth", "14");
row.put("DayOfWeek", "3");
row.put("CRSDepTime", "730");
row.put("UniqueCarrier", "PS");
row.put("Origin", "SAN");
row.put("Dest", "SFO");
BinomialModelPrediction p = model.predictBinomial(row);
System.out.println("Label (aka prediction) is flight departure delayed: " + p.label);
System.out.print("Class probabilities: ");
- Do I need anything else than Java Runtime Environment (JRE) on the server to query a POJO for a prediction?
Thank you Tom.Nothing surprising in the answers - it seems I had understood it correctly, so not sure why I couldn't make it work.
--
Ok, follow-ups:- My model is a GBM, but the prediction is a float, not a simple yes/no. Should I still use predictBinomial or is there another wrapper method, or should I use score0 directly?
- Step 4 - creating the main program: Do I still need H2O at that point or it can be done in a different environment? Which files are needed exactly at this point? Just the POJO and the h2o-genmodel.jar?
--
Hi Michal,
Hi,
I want to use REST api to import and parse file, I am able to do it on http://10.230.17.156:54321/flow/index.html
But how to do it on localhost?