2015-10-11 51 views
1

我想合奏與H2O物流regresion在R.然而,一個錯誤信息會出現在下面的代碼隨機森林:`h2o.cbind`只接受H2OFrame對象 - R的

> 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。可能是錯誤的原因是什麼?

回答

1

看起來您可能正在使用舊版本的h2o或h2oEnsemble軟件包。 H2O數據幀的對象類別曾被稱爲H2OFrame,現在它只是被稱爲Frame,而h2o.cbind正在尋找類型爲H2OFrame的對象。

您可以通過更新您的H2O和h2oEnsemble包到最新版本如下解決這個問題:

# 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如下:

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

你總是可以找到最新的穩定(或出血邊緣)版本的水在http://h2o.ai/download/

+1

歡迎來到SO,Erin L :) –

+0

請做**不要用**回答提問者的回覆,請改用評論; – aschipfl

+0

謝謝,我會更新我的答案,所以它不會要求回覆。該解決方案應該解決這個問題。 –

相關問題