Search in sources :

Example 1 with RegressionModelPrediction

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);
}
Also used : RowData(hex.genmodel.easy.RowData) RegressionModelPrediction(hex.genmodel.easy.prediction.RegressionModelPrediction) URL(java.net.URL) EasyPredictModelWrapper(hex.genmodel.easy.EasyPredictModelWrapper)

Aggregations

EasyPredictModelWrapper (hex.genmodel.easy.EasyPredictModelWrapper)1 RowData (hex.genmodel.easy.RowData)1 RegressionModelPrediction (hex.genmodel.easy.prediction.RegressionModelPrediction)1 URL (java.net.URL)1