h2oai / h2o-3

H2O is an Open Source, Distributed, Fast & Scalable Machine Learning Platform: Deep Learning, Gradient Boosting (GBM) & XGBoost, Random Forest, Generalized Linear Modeling (GLM with Elastic Net), K-Means, PCA, Generalized Additive Models (GAM), RuleFit, Support Vector Machine (SVM), Stacked Ensembles, Automatic Machine Learning (AutoML), etc.
http://h2o.ai
Apache License 2.0
6.78k stars 1.99k forks source link

GAM prediction with NPE #7667

Open exalate-issue-sync[bot] opened 1 year ago

exalate-issue-sync[bot] commented 1 year ago

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:

{noformat}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 {noformat}

What can I do? Thank you

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

h2o-ops commented 1 year ago

JIRA Issue Details

Jira Issue: PUBDEV-7977 Assignee: Wendy Reporter: Wendy State: Open Fix Version: N/A Attachments: N/A Development PRs: N/A