hex.genmodel.easy.package-info Maven / Gradle / Ivy
/**
* The easy prediction API for generated POJO and MOJO models.
*
* Use as follows:
*
* - Instantiate an EasyPredictModelWrapper
* - Create a new row of data
* - Call one of the predict methods
*
*
*
* Here is an example:
*
*
* {@code
* // Step 1.
* modelClassName = "your_pojo_model_downloaded_from_h2o";
* GenModel rawModel;
* rawModel = (GenModel) Class.forName(modelClassName).newInstance();
* EasyPredictModelWrapper model = new EasyPredictModelWrapper(rawModel);
* //
* // By default, unknown categorical levels throw PredictUnknownCategoricalLevelException.
* // Optionally configure the wrapper to treat unknown categorical levels as N/A instead:
* //
* // EasyPredictModelWrapper model = new EasyPredictModelWrapper(
* // new EasyPredictModelWrapper.Config()
* // .setModel(rawModel)
* // .setConvertUnknownCategoricalLevelsToNa(true));
*
* // Step 2.
* RowData row = new RowData();
* row.put(new String("CategoricalColumnName"), new String("LevelName"));
* row.put(new String("NumericColumnName1"), new String("42.0"));
* row.put(new String("NumericColumnName2"), Double.valueOf(42.0));
*
* // Step 3.
* BinomialModelPrediction p = model.predictBinomial(row);
* }
*
*/
package hex.genmodel.easy;