1
votes

I am trying to model same data in h2o. The problem I have is that beside the fact that the model fit process goes smoothly I get an error when I try to use the model to make prediction. I do not have a good knowledge of Java so I do not know what the error is. The strange thing is that sometimes occurs and sometimes does not. Here the error message:

java.lang.NullPointerException

java.lang.NullPointerException
    at water.MRTask.dfork(MRTask.java:459)
    at water.MRTask.doAll(MRTask.java:396)
    at water.MRTask.doAll(MRTask.java:403)
    at hex.gam.GAMModel.predictScoreImpl(GAMModel.java:533)
    at hex.Model.score(Model.java:1618)
    at water.api.ModelMetricsHandler$1.compute2(ModelMetricsHandler.java:403)
    at water.H2O$H2OCountedCompleter.compute(H2O.java:1575)
    at jsr166y.CountedCompleter.exec(CountedCompleter.java:468)
    at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
    at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
    at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
    at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)

Error: java.lang.NullPointerException

What can I do? Thank you

1
Can you share the code you used to generate this error? How were you predicting: in the H2O client (R/Py) or with Java if so, was it with a MOJO file? Also please provide H2O version information.Erin LeDell

1 Answers

0
votes

If anyone has encountered the same issue, I found the solution. For whatever reason the predict method fails if the data is not shaped in the way the algorithm has been trained on, and this also includes the outcome column. In order to make the method not to break I just added a fake outcome column with all zeros as a placeholder. Now everything works fine. Thank you