r - h2oensemble 值错误[[3L]](cond) : argument "training_frame" must be a valid H2O H2OFrame or id

标签 r cran h2o ensemble-learning

尝试在 http://learn.h2o.ai/content/tutorials/ensembles-stacking/index.html 上找到的 H2OEnsemble 上运行示例时在 Rstudio 中,我遇到以下错误:

Error in value[3L] : argument "training_frame" must be a valid H2O H2OFrame or id

定义整体后

fit <- h2o.ensemble(x = x, y = y, 
                    training_frame = train, 
                     family = family, 
                     learner = learner, 
                     metalearner = metalearner,
                     cvControl = list(V = 5, shuffle = TRUE))

我安装了 h2oh2oEnsemble 的最新版本,但问题仍然存在。我读过这里`h2o.cbind` accepts only of H2OFrame objects - R h2o 中的命名约定随着时间的推移而改变,但我认为通过安装两者的最新版本,这应该不再是问题。

有什么建议吗?

library(readr)
library(h2oEnsemble)  # Requires version >=0.0.4 of h2oEnsemble
library(cvAUC)  # Used to calculate test set AUC (requires version >=1.0.1 of cvAUC)
localH2O <-  h2o.init(nthreads = -1)  # Start an H2O cluster with nthreads = num cores on your machine





# Import a sample binary outcome train/test set into R
train <- h2o.importFile("http://www.stat.berkeley.edu/~ledell/data/higgs_10k.csv")
test <- h2o.importFile("http://www.stat.berkeley.edu/~ledell/data/higgs_test_5k.csv")
y <- "C1"
x <- setdiff(names(train), y)
family <- "binomial"

#For binary classification, response should be a factor
train[,y] <- as.factor(train[,y])  
test[,y] <- as.factor(test[,y])


# Specify the base learner library & the metalearner
learner <- c("h2o.glm.wrapper", "h2o.randomForest.wrapper", 
               "h2o.gbm.wrapper", "h2o.deeplearning.wrapper")
metalearner <- "h2o.deeplearning.wrapper"


# Train the ensemble using 5-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, 
                    training_frame = train, 
                    family = family, 
                    learner = learner, 
                    metalearner = metalearner,
                    cvControl = list(V = 5, shuffle = TRUE))

最佳答案

此错误最近是由于对 h2o R 代码进行类名的批量查找/替换更改而引入的。该更改也无意中应用到了集成代码文件夹(我们目前在其中进行手动测试而不是自动测试 - 很快就会自动测试以防止此类情况发生)。我已经修复了这个错误。

要修复此问题,请从 GitHub 重新安装 h2oEnsemble 包:

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

感谢您的报告!为了更快地得到回复,请在此处发布错误和问题:https://groups.google.com/forum/#!forum/h2ostream

关于r - h2oensemble 值错误[[3L]](cond) : argument "training_frame" must be a valid H2O H2OFrame or id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34267983/

相关文章:

r - 将列转换为日期类型会更改原始值的年份

r - R 中的 cv.lars 错误

r - 如何检查CRAN镜像是否过时?

r - 错误 : unable to collate and parse R files for package - upload to CRAN

r - show()、hide() 使用来自 Shinyjs、Shiny

r - 如何进行 data.table 滚动连接?

r - stop() 中忽略的附加参数

python - H2O python split_frame 抛出异常

python - Python 中的 H2OFrame() 正在向 Pandas DataFrame 添加额外的重复行 - Bug?

hadoop - H20 Hadoop 启动