[英]h2oensemble Error in value[[3L]](cond) : argument “training_frame” must be a valid H2O H2OFrame or id
While trying to run the example on H2OEnsemble found on http://learn.h2o.ai/content/tutorials/ensembles-stacking/index.html from within Rstudio, I encounter the following error: 尝试在Rstudio中在http://learn.h2o.ai/content/tutorials/ensembles-stacking/index.html上找到的H2OEnsemble上运行示例时,遇到以下错误:
Error in value[3L] : argument "training_frame" must be a valid H2O H2OFrame or id
value [3L]中的错误:参数“ training_frame”必须是有效的H2O H2OFrame或id
after defining the ensemble 定义合奏之后
fit <- h2o.ensemble(x = x, y = y,
training_frame = train,
family = family,
learner = learner,
metalearner = metalearner,
cvControl = list(V = 5, shuffle = TRUE))
I installed the latest version of both h2o
and h2oEnsemble
but the issue remains. 我安装了
h2o
和h2oEnsemble
的最新版本,但问题仍然存在。 I have read here `h2o.cbind` accepts only of H2OFrame objects - R that the naming convention in h2o
changed over time, but I assume by installing the latest version of both this should not be any longer the issue. 我在这里已经读过`h2o.cbind`只接受H2OFrame对象-R
h2o
中的命名约定会随着时间而改变,但是我认为通过安装这两个版本的最新版本不再是问题。
Any suggestions? 有什么建议么?
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))
This bug was recently introduced by a bulk find/replace change of a class name made to the h2o R code. 最近通过对H2o R代码进行类名的批量查找/替换更改,引入了此错误。 The change was inadvertently applied to the ensemble code folder as well (where we currently have manual instead of automatic tests -- soon to be automatic to prevent this sort of thing).
所做的更改也被无意中应用到了合奏代码文件夹中(我们目前在此处使用手动而不是自动测试-很快将自动防止这种情况发生)。 I've fixed the bug.
我已经修复了该错误。
To fix, reinstall the h2oEnsemble package from GitHub: 要修复,请从GitHub重新安装h2oEnsemble软件包:
library(devtools)
install_github("h2oai/h2o-3/h2o-r/ensemble/h2oEnsemble-package")
Thanks for the report! 感谢您的举报! For a quicker response, post bugs and questions here: https://groups.google.com/forum/#!forum/h2ostream
为了更快地做出响应,请在此处发布错误和问题: https : //groups.google.com/forum/#!forum/h2ostream
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.