All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hex.genmodel.easy.package-info Maven / Gradle / Ivy

There is a newer version: 3.46.0.6
Show newest version
/**
 * The easy prediction API for generated POJO and MOJO models.
 *
 * Use as follows:
 * 
    *
  1. Instantiate an EasyPredictModelWrapper
  2. *
  3. Create a new row of data
  4. *
  5. Call one of the predict methods
  6. *
* *

* 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;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy