use of hex.genmodel.easy.prediction.RegressionModelPrediction in project h2o-3 by h2oai.
the class MojoReaderBackendFactoryTest method testMojoE2E.
private void testMojoE2E(CachingStrategy cachingStrategy) throws Exception {
URL mojoSource = MojoReaderBackendFactoryTest.class.getResource("mojo.zip");
assertNotNull(mojoSource);
MojoReaderBackend reader = MojoReaderBackendFactory.createReaderBackend(mojoSource, cachingStrategy);
MojoModel model = ModelMojoReader.readFrom(reader);
EasyPredictModelWrapper modelWrapper = new EasyPredictModelWrapper(model);
RowData testRow = makeTestRow();
RegressionModelPrediction prediction = (RegressionModelPrediction) modelWrapper.predict(testRow);
assertEquals(71.085d, prediction.value, 0.001d);
}
Aggregations