h2oai / h2o-3

H2O is an Open Source, Distributed, Fast & Scalable Machine Learning Platform: Deep Learning, Gradient Boosting (GBM) & XGBoost, Random Forest, Generalized Linear Modeling (GLM with Elastic Net), K-Means, PCA, Generalized Additive Models (GAM), RuleFit, Support Vector Machine (SVM), Stacked Ensembles, Automatic Machine Learning (AutoML), etc.
http://h2o.ai
Apache License 2.0
6.88k stars 1.99k forks source link

Add documentation to Mojo that will take an input file, mojo will generate an output predict csv. #15935

Open wendycwong opened 10 months ago

wendycwong commented 10 months ago

In our current documentation, we provided code on how to use our mojo to make one prediction here:

https://docs.h2o.ai/h2o/latest-stable/h2o-docs/mojo-quickstart.html

However, there are users that would like to have provide a dataset in a file, use the mojo to generate prediction in a csv file for data stored in the input dataset.

I have generated a file for exactly that.

wendycwong commented 10 months ago

Here, please follow the steps in the link: https://docs.h2o.ai/h2o/latest-stable/h2o-docs/mojo-quickstart.html .

However, for the java file, use this one instead PredictCsv.java:

prediction.csv

Hence, make sure you have the following in your experiment folder:

You will do the following:

javac -cp .:h2o-genmodel.jar PredictCsv.java java -cp .:h2o-genmodel.jar PredictCsv.java mojoModelXXX.zip inputDataset.csv predictionOutput.csv

After you run the above commands you should be able to see your model prediction. The prediction.csv is the inputDataset.csv file.

wendycwong commented 10 months ago

This is the java file to have: PredictCsv.txt

wendycwong commented 10 months ago

Please change the name back to PredictCsv.java. I was not allowed to add the file with .java extension.