Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoxPH performance fails, if factor used as event_column #7816

Closed
exalate-issue-sync bot opened this issue May 11, 2023 · 1 comment
Closed

CoxPH performance fails, if factor used as event_column #7816

exalate-issue-sync bot opened this issue May 11, 2023 · 1 comment

Comments

@exalate-issue-sync
Copy link

CoxPH performance fails, if factor used as event_column

library(data.table)
survdata = fread(file="~/Downloads/dallas_shelter_survdata_FY18-20.csv.gz")
coxph_features = c("intake_condition","intake_type", "animal_breed", "chip_status", 
                   "surv_hours", "event")
survdata.hex = as.h2o(survdata[, ..coxph_features])
survdata.hex$event = as.factor(survdata.hex$event)
survdata.hex$intake_condition = as.factor(survdata.hex$intake_condition)
survdata.hex$intake_type = as.factor(survdata.hex$intake_type)
survdata.hex$animal_breed = as.factor(survdata.hex$animal_breed)
survdata.hex$chip_status = as.factor(survdata.hex$chip_status)
h2o_coxph_fit = h2o.coxph(model_id = "Dallas-animal-shelter-coxph-model",
                           training_frame = survdata.hex,
                           stop_column = "surv_hours",
                           event_column = "event", 
                           stratify_by = "intake_type")
summary(h2o_coxph_fit)
h2o.performance(h2o_coxph_fit, data=survdata.hex)@metrics$concordance
h2o.performance(h2o_coxph_fit, newdata=survdata.hex)@metrics$concordance

fails with

ERROR: Unexpected HTTP Status code: 500 Server Error (url = http://localhost:54321/3/ModelMetrics/models/Dallas-animal-shelter-coxph-model/frames/RTMP_sid_8548_16)
java.lang.NullPointerException
 [1] "java.lang.NullPointerException"                                                                              
 [2] "    water.fvec.WrappedVec.masterVec(WrappedVec.java:24)"                                                     
 [3] "    water.fvec.CategoricalWrappedVec.masterVec(CategoricalWrappedVec.java:26)"                               
 [4] "    water.fvec.CategoricalWrappedVec.computeMap(CategoricalWrappedVec.java:124)"                             
 [5] "    water.fvec.CategoricalWrappedVec.makeTransientVec(CategoricalWrappedVec.java:45)"                        
 [6] "    water.fvec.CategoricalWrappedVec.updateDomain(CategoricalWrappedVec.java:59)"                            
 [7] "    hex.Model.score(Model.java:1641)"                                                                        
 [8] "    water.api.ModelMetricsHandler.score(ModelMetricsHandler.java:259)"                                       
 [9] "    java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)"                          
[10] "    java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)"        
[11] "    java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"
[12] "    java.base/java.lang.reflect.Method.invoke(Method.java:567)"                                              
[13] "    water.api.Handler.handle(Handler.java:60)"                                                               
[14] "    water.api.RequestServer.serve(RequestServer.java:470)"                                                   
[15] "    water.api.RequestServer.doGeneric(RequestServer.java:301)"                                               
[16] "    water.api.RequestServer.doPost(RequestServer.java:227)"                                                  
[17] "    javax.servlet.http.HttpServlet.service(HttpServlet.java:707)"                                            
[18] "    javax.servlet.http.HttpServlet.service(HttpServlet.java:790)"                                            
[19] "    org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)"                                  
[20] "    org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)"                              
[21] "    org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)"                       
[22] "    org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)"                      
[23] "    org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)"                        
[24] "    org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)"                               
[25] "    org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)"                        
[26] "    org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)"                       
[27] "    org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)"                           
[28] "    org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)"                   
[29] "    org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)"                         
[30] "    water.webserver.jetty9.Jetty9ServerAdapter$LoginHandler.handle(Jetty9ServerAdapter.java:130)"            
[31] "    org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)"                   
[32] "    org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)"                         
[33] "    org.eclipse.jetty.server.Server.handle(Server.java:531)"                                                 
[34] "    org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)"                                       
[35] "    org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)"                             
[36] "    org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)"             
[37] "    org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)"                                       
[38] "    org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)"                                    
[39] "    org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)"                  
[40] "    org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)"                
[41] "    org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)"               
[42] "    org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)"                      
[43] "    org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)"
[44] "    org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)"                        
[45] "    org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)"                         
[46] "    java.base/java.lang.Thread.run(Thread.java:835)"                         

Codiscovered with [~accountid:5a1ed71ecba5b30325a783ad]

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

JIRA Issue Migration Info

Jira Issue: PUBDEV-7825
Assignee: Ondrej Nekola
Reporter: Ondrej Nekola
State: Resolved
Fix Version: 3.32.1.1
Attachments: N/A
Development PRs: Available

Linked PRs from JIRA

#5002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant