h2o.cbind只接受H2OFrame对象-R [英] `h2o.cbind` accepts only of H2OFrame objects - R

查看:92
本文介绍了h2o.cbind只接受H2OFrame对象-R的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用R中的H2O将具有Logistic递归的随机森林集成在一起.但是,以下代码中会出现错误消息:

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

显然,我的参数正确给出了,但是如您所见,消息为:h2o.cbind accepts only of H2OFrame objects appears.错误的原因可能是什么?

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?

推荐答案

您似乎正在使用h2o或h2oEnsemble软件包的较旧版本. H2O数据帧的对象类以前称为H2OFrame,现在仅称为Frame,而h2o.cbind正在寻找类型为H2OFrame的对象.

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 called Frame, and h2o.cbind is looking for for an object of type, H2OFrame.

您可以通过将h2o和h2oEnsemble软件包更新为最新版本来解决此问题,如下所示:

You can fix this by updating your h2o and h2oEnsemble packages to the latest version as follows:

# The following two commands remove any previously installed H2O packages for R.
if ("package:h2o" %in% search()) { detach("package:h2o", unload=TRUE) }
if ("h2o" %in% rownames(installed.packages())) {remove.packages("h2o") }

# Now we download, install and initialize the latest stable release of the *h2o* package for R.
install.packages("h2o", type="source", repos=(c("http://h2o-release.s3.amazonaws.com/h2o/rel-slater/5/R")))
library(h2o)

然后按如下所示更新您的h2oEnsemble:

Then update your h2oEnsemble as follows:

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

您始终可以在 http://h2o.ai/download上找到最新的H2O稳定版本(或最新版本). /.

这篇关于h2o.cbind只接受H2OFrame对象-R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆