Unexpected HTTP Status code: 412 Precondition Failed

1,955 views
Skip to first unread message

Alireza Sedghi

unread,
Oct 12, 2015, 3:26:49 PM10/12/15
to H2O Open Source Scalable Machine Learning - h2ostream
Hi

i have a list (a) which has 15 different data.frames ( data1 <- a[[1]] , data2 <- a[[2]] ..... data15<- a[[15]] )
they have same number of columns but different row numbers.

i get the following error only on the 15th. some error about network?

thanks for any comment



> library(h2o)
> h2oServer <- h2o.init(ip="localhost", port=54321, max_mem_size="4g", nthreads=-1)
Successfully connected to http://localhost:54321/ 

R is connected to the H2O cluster: 
    H2O cluster uptime:         9 minutes 26 seconds 
    H2O cluster version:        3.2.0.5 
    H2O cluster name:           H2O_started_from_R_arsed_000_eun184 
    H2O cluster total nodes:    1 
    H2O cluster total memory:   3.56 GB 
    H2O cluster total cores:    8 
    H2O cluster allowed cores:  8 
    H2O cluster healthy:        TRUE 


> data1 <- as.h2o(a[[14]])
  |=============================================================================================================================| 100%
> data2 <- as.h2o(a[[15]])

ERROR: Unexpected HTTP Status code: 412 Precondition Failed (url = http://localhost:54321/3/ParseSetup)

water.exceptions.H2OIllegalArgumentException
 [1] "water.parser.ParseSetup.strToColumnTypes(ParseSetup.java:133)"         
 [2] "water.parser.ParseSetup.<init>(ParseSetup.java:75)"                    
 [3] "water.api.ParseSetupHandler.guessSetup(ParseSetupHandler.java:34)"     
 [4] "sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)"           
 [5] "sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)"           
 [6] "sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)"       
 [7] "java.lang.reflect.Method.invoke(Unknown Source)"                       
 [8] "water.api.Handler.handle(Handler.java:58)"                             
 [9] "water.api.RequestServer.handle(RequestServer.java:668)"                
[10] "water.api.RequestServer.serve(RequestServer.java:609)"                 
[11] "water.JettyHTTPD$H2oDefaultServlet.doGeneric(JettyHTTPD.java:617)"     
[12] "water.JettyHTTPD$H2oDefaultServlet.doPost(JettyHTTPD.java:565)"        
[13] "javax.servlet.http.HttpServlet.service(HttpServlet.java:755)"          
[14] "javax.servlet.http.HttpServlet.service(HttpServlet.java:848)"          
[15] "org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)"

Error in .h2o.doSafeREST(conn = conn, h2oRestApiVersion = h2oRestApiVersion,  : 
  Provided column type impute is unknown.

Avni Wadhwa

unread,
Oct 12, 2015, 4:34:56 PM10/12/15
to H2O Open Source Scalable Machine Learning - h2ostream
Hi,

The column type that you are trying to import (impute) is not supported by h2o. Try converting the column type to a numeric or enum using as.factor or as.numeric and then do an as.h2o. For example, using the Breast Cancer data:
> t <- BreastCancer$Cl.thickness
> factor(t, ordered = F)
> as.h2o(factor(t, ordered = F))

Hope this helps!

Avni

Alireza Sedghi

unread,
Oct 13, 2015, 8:50:34 AM10/13/15
to H2O Open Source Scalable Machine Learning - h2ostream

Hi
Thanks for your comment
I was wondering why it is not giving such an error for others? They are all the same( i splitted one large dataset into 15 small datasets with same column(features))

Thanks again

Alireza Sedghi

unread,
Oct 13, 2015, 9:17:20 AM10/13/15
to H2O Open Source Scalable Machine Learning - h2ostream
I found the problem.
my data set has NA values in it, first i used impute function to replace the missing values with Median, with the following command :

data$Au <- with(data, impute(Au,median))

but when i used other method for imputation ( VIM package , function "irmi" ) it does not give such an error.

thanks

Spencer Aiello

unread,
Oct 13, 2015, 11:44:06 AM10/13/15
to Alireza Sedghi, H2O Open Source Scalable Machine Learning - h2ostream
By the way, h2o can perform the data imputation and splitting as well: h2o.impute and standard R slicing should suffice.

There are also primitives for generating N folds (stratified, modulo, and random), that may also be of interest to you. 

HTH
--
You received this message because you are subscribed to the Google Groups "H2O Open Source Scalable Machine Learning - h2ostream" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h2ostream+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages