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.91k stars 2k forks source link

java.lang.AssertionError when using h2o.makeGLMModel #10859

Closed exalate-issue-sync[bot] closed 1 year ago

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

Code:

Load packages & start h2o

library(insuranceData) library(h2o) h2o.init()

Load data into h2o

data(AutoClaims) h2odata <- as.h2o(AutoClaims)

Build model in h2o:

predictors <- names(AutoClaims)[!names(AutoClaims) == "PAID"] h2oglm <- h2o.glm(training_frame=h2odata, x=predictors, y="PAID", family="gamma", link="log", lambda_search = TRUE)

Can see that during lambda search 39 models have been created:

regpath <- h2o.getGLMFullRegularizationPath(h2oglm)

Extract coefficients from the final model to create a new GLM

coefs2 = regpath$coefficients[nrow(regpath$coefficients),] model2 <- h2o.makeGLMModel(h2oglm,coefs2)

Error: ERROR: Unexpected HTTP Status code: 500 Server Error (url = http://localhost:54321/3/MakeGLMModel) java.lang.AssertionError [1] "java.lang.AssertionError: null vec: $04ff03000000ffffffff2a67a45f197580aa2343bcad46071bd7$" [2] " water.fvec.Frame.(Frame.java:112)" [3] " water.fvec.Frame.(Frame.java:83)" [4] " hex.glm.GLMModel$GLMOutput.(GLMModel.java:799)" [5] " hex.glm.GLMModel$GLMOutput.(GLMModel.java:812)" [6] " hex.api.MakeGLMModelHandler.make_model(MakeGLMModelHandler.java:41)" [7] " sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)" [8] " sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)" [9] " sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)" [10] " java.lang.reflect.Method.invoke(Method.java:498)" [11] " water.api.Handler.handle(Handler.java:61)" [12] " water.api.RequestServer.serve(RequestServer.java:412)" [13] " water.api.RequestServer.doGeneric(RequestServer.java:263)" [14] " water.api.RequestServer.doPost(RequestServer.java:200)" [15] " javax.servlet.http.HttpServlet.service(HttpServlet.java:755)" [16] " javax.servlet.http.HttpServlet.service(HttpServlet.java:848)" [17] " org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)" [18] " org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)" [19] " org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)" [20] " org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)" [21] " org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)" [22] " org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)" [23] " org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)" [24] " org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)" [25] " org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)" [26] " org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)" [27] " org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)" [28] " org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)" [29] " org.eclipse.jetty.server.Server.handle(Server.java:370)" [30] " org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)" [31] " org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)" [32] " org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)" [33] " org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)" [34] " org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)" [35] " org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)" [36] " org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)" [37] " org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)" [38] " org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)" [39] " org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)" [40] " java.lang.Thread.run(Thread.java:745)" Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page, : ERROR MESSAGE: java.lang.AssertionError: null vec: $04ff03000000ffffffff2a67a45f197580aa2343bcad46071bd7$

Reference: https://community.h2o.ai/questions/1544/javalangassertionerror-when-using-h2omakeglmmodel.html

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

Tomas Nykodym commented: Fixed.

h2o-ops commented 1 year ago

JIRA Issue Migration Info

Jira Issue: PUBDEV-3966 Assignee: Tomas Nykodym Reporter: Avkash Chauhan State: Closed Fix Version: 3.10.3.1 Attachments: N/A Development PRs: N/A