I'm trying to ensemble a random forest with logistic regresion with H2O in R. However, an error messages appears in the following code:
> localH2O = h2o.init()
Successfully connected to http://137.0.0.1:43329/
R is connected to the H2O cluster:
H2O cluster uptime: 3 hours 11 minutes
H2O cluster version: 3.2.0.3
H2O cluster name: H2O_started_from_R_toshiba_jvd559
H2O cluster total nodes: 1
H2O cluster total memory: 0.97 GB
H2O cluster total cores: 4
H2O cluster allowed cores: 2
H2O cluster healthy: TRUE
>
> # defining the training data and set data for H2O
>
> training_frame <- as.h2o(localH2O, muestra.fullarbol)
|=========================================================================================| 100%
> validation_frame <- as.h2o(localH2O, test.fullarbol)
|=========================================================================================| 100%
>
> yn <- "ex"
> xn <- names(datafullarbol[,-c(1,2,3,9,10,11,12,17,19,20,21,22,23,24,29,31,32,33,34,35,36,47)])
>
>
>
>
> learner <- c("h2o.glm.wrapper", "h2o.randomForest.wrapper")
> metalearner <- "SL.glm"
> family <- "binomial"
>
> fit <- h2o.ensemble(x=xn, y=yn,training_frame = training_frame, family = family,
+ learner = learner, metalearner = metalearner,cvControl = list(V = 5))
|=========================================================================================| 100%
[1] "Cross-validating and training base learner 1: h2o.glm.wrapper"
|=========================================================================================| 100%
[1] "Cross-validating and training base learner 2: h2o.randomForest.wrapper"
|=========================================================================================| 100%
Error in h2o.cbind(predlist) :
`h2o.cbind` accepts only of H2OFrame objects
Apperently my parameters are given correctly , but as you see, the message: h2o.cbind accepts only of H2OFrame objects appears
. What could be the reason of the error?
It looks like you may be using either an older version of the h2o or h2oEnsemble package. The object class of an H2O data frame used to be called
H2OFrame
and now it's just calledFrame
, andh2o.cbind
is looking for for an object of type,H2OFrame
.You can fix this by updating your h2o and h2oEnsemble packages to the latest version as follows:
Then update your h2oEnsemble as follows:
You can always find the latest stable (or bleeding edge) version of H2O at http://h2o.ai/download/.