R H20Ensemble error

601 views
Skip to first unread message

gavin....@gmail.com

unread,
Feb 6, 2016, 1:55:00 PM2/6/16
to H2O Open Source Scalable Machine Learning - h2ostream
Hi,

When trying to run the R H2OEnsemble example, I get an error from the following command:

'fit <- h2o.ensemble(x = x, y = y, data = data, family = family,
+ learner = learner, metalearner = metalearner,
+ cvControl = list(V=4))'

The error is:

ERROR: Unexpected HTTP Status code: 400 Bad Request (url = http://127.0.0.1:54321/99/Rapids)

java.lang.IllegalArgumentException
[1] "water.rapids.ASTNumList.exec(ASTNumList.java:130)"
[2] "water.rapids.ASTAppend.apply(ASTAssign.java:226)"
[3] "water.rapids.ASTAppend.apply(ASTAssign.java:220)"
[4] "water.rapids.ASTExec.exec(ASTExec.java:46)"
[5] "water.rapids.ASTTmpAssign.apply(ASTAssign.java:255)"
[6] "water.rapids.ASTTmpAssign.apply(ASTAssign.java:248)"
[7] "water.rapids.ASTExec.exec(ASTExec.java:46)"
[8] "water.rapids.Session.exec(Session.java:56)"
[9] "water.rapids.Exec.exec(Exec.java:63)"
[10] "water.api.RapidsHandler.exec(RapidsHandler.java:23)"
[11] "sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)"
[12] "sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"
[13] "java.lang.reflect.Method.invoke(Method.java:498)"
[14] "water.api.Handler.handle(Handler.java:64)"
[15] "water.api.RequestServer.handle(RequestServer.java:644)"
[16] "water.api.RequestServer.serve(RequestServer.java:585)"
[17] "water.JettyHTTPD$H2oDefaultServlet.doGeneric(JettyHTTPD.java:617)"
[18] "water.JettyHTTPD$H2oDefaultServlet.doPost(JettyHTTPD.java:565)"
[19] "javax.servlet.http.HttpServlet.service(HttpServlet.java:755)"
[20] "javax.servlet.http.HttpServlet.service(HttpServlet.java:848)"
[21] "org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)"

Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page, :
Number list not allowed here
In addition: Warning message:
In if (is.na(value)) value <- NA_integer_ else if (!is.numeric(value) && :
the condition has length > 1 and only the first element will be used


It seems the error is being generated by ASTNumList.java. I noticed that some commands in the R example have been updated, e.g. losing the localH2O in data <- as.h2o(localH2O, train). I'm wondering if the h2o.ensemble function has the correct arguments?

Any help would be greatly appreciated.

Thanks,

Gavin.

Erin LeDell

unread,
Feb 6, 2016, 2:55:50 PM2/6/16
to gavin....@gmail.com, H2O Open Source Scalable Machine Learning - h2ostream
Hi Gavin,
Can you provide a bit more information? Please let me know the version
number of both the h2o package and h2oEnsemble package and also a
reproducible example. We removed the connection object from the
as.h2o(), so you may want to update your h2o to the latest stable
version and try again.

Before our text h2o release, I will add a table to the h2oEnsemble
README that explicitly describes the version of h2oEnsemble that is
compatible with each version of h2o, along with links to the older
versions of the h2oEnsmeble package.

Best,
Erin
--
Erin LeDell Ph.D.
Statistician & Machine Learning Scientist | H2O.ai

gavin....@gmail.com

unread,
Feb 6, 2016, 3:15:38 PM2/6/16
to H2O Open Source Scalable Machine Learning - h2ostream, gavin....@gmail.com
Hi,

H2O version: 3.6.0.8; H2OEnsemble version: 0.0.3.

The example is from the help file:

library(h2oEnsemble)
library(SuperLearner) # For metalearner such as "SL.glm"
library(cvAUC) # Used to calculate test set AUC (requires version >=1.0.1 of cvAUC)
localH2O <- h2o.init(ip = "localhost", port = 54321, startH2O = TRUE, nthreads = -1)


# Import a sample binary outcome train/test set into R
train <- read.table("http://www.stat.berkeley.edu/~ledell/data/higgs_5k.csv", sep=",")
test <- read.table("http://www.stat.berkeley.edu/~ledell/data/higgs_test_5k.csv", sep=",")


# Convert R data.frames into H2O parsed data objects
data <- as.h2o(localH2O, train)
newdata <- as.h2o(localH2O, test)
y <- "V1"
x <- setdiff(names(data), y)
family <- "binomial"


# Create a custom base learner library & specify the metalearner
h2o.randomForest.1 <- function(..., ntrees = 1000, nbins = 100, seed = 1) h2o.randomForest.wrapper(..., ntrees = ntrees, nbins = nbins, seed = seed)
h2o.deeplearning.1 <- function(..., hidden = c(500,500), activation = "Rectifier", seed = 1) h2o.deeplearning.wrapper(..., hidden = hidden, activation = activation, seed = seed)
h2o.deeplearning.2 <- function(..., hidden = c(200,200,200), activation = "Tanh", seed = 1) h2o.deeplearning.wrapper(..., hidden = hidden, activation = activation, seed = seed)
learner <- c("h2o.randomForest.1", "h2o.deeplearning.1", "h2o.deeplearning.2")
metalearner <- c("SL.glm")


# Train the ensemble using 4-fold CV to generate level-one data
# More CV folds will take longer to train, but should increase performance


fit <- h2o.ensemble(x = x, y = y, data = data, family = family,

learner = learner, metalearner = metalearner,

cvControl = list(V=4))

Gavin.

gavin....@gmail.com

unread,
Feb 6, 2016, 3:20:07 PM2/6/16
to H2O Open Source Scalable Machine Learning - h2ostream, gavin....@gmail.com

Sorry, as previously mentioned, I've replaced the data upload to H2O with the following lines:

data <- as.h2o(train)
newdata <- as.h2o(test)

Erin LeDell

unread,
Feb 6, 2016, 3:33:29 PM2/6/16
to gavin....@gmail.com, H2O Open Source Scalable Machine Learning - h2ostream
Ok, that's all I need to know. :)  You are using a really old version of h2oEnsemble. 

To upgrade to 0.1.5, the latest stable version of ensemble, install directly from github:

library(devtools)
install_github("h2oai/h2o-3/h2o-r/ensemble/h2oEnsemble-package")

I will add some sort of check to h2oEnsemble so that it's obvious to people that there is an incompatibility.  Thanks!

-Erin
Message has been deleted

gavin....@gmail.com

unread,
Feb 6, 2016, 3:54:10 PM2/6/16
to H2O Open Source Scalable Machine Learning - h2ostream, gavin....@gmail.com
Wonderful everything's working now, thanks!! The problem is I searched Google for installation instructions and it sent me to H2O version 2, which is outdated.

Gavin.

Erin LeDell

unread,
Feb 6, 2016, 5:11:27 PM2/6/16
to gavin....@gmail.com, H2O Open Source Scalable Machine Learning - h2ostream
Good to know, thanks! I'll try to make the versioning info more clear
in the next release.

On 2/6/16 12:54 PM, gavin....@gmail.com wrote:
> Wonderful everything's working now, thanks!! The problem is I searched Google for installation instructions and it sent me to H2O version 2, which is outdated.
>
> Gavin.
>

Message has been deleted

Erin LeDell

unread,
Feb 11, 2016, 4:25:17 PM2/11/16
to jmiller...@gmail.com, H2O Open Source Scalable Machine Learning - h2ostream, gavin....@gmail.com
Did you solve your problem by looking at the other responses or do you
still have issues?

On 2/11/16 12:13 PM, jmiller...@gmail.com wrote:
> I have the same problem.
Reply all
Reply to author
Forward
0 new messages