h2oensemble值[[3L]](cond)中的错误:参数"training_frame"必须是有效的H2O H2OFrame或ID [英] h2oensemble Error in value[[3L]](cond) : argument "training_frame" must be a valid H2O H2OFrame or id
问题描述
尝试在 http:/上找到的H2OEnsemble上运行示例时在Rstudio中/learn.h2o.ai/content/tutorials/ensembles-stacking/index.html ,我遇到以下错误:
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:
值[3L]错误: 参数"training_frame"必须是有效的H2O H2OFrame或ID
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))
我安装了h2o
和h2oEnsemble
的最新版本,但问题仍然存在.我已经在这里阅读`h2o.cbind`仅接受H2OFrame对象-R h2o
中的命名约定会随着时间而改变,但是我认为通过同时安装这两个版本的最新版本,这应该不再是问题.
I installed the latest version of both h2o
and h2oEnsemble
but the issue remains. 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.
有什么建议吗?
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代码进行的类名的批量查找/替换更改而引入的.所做的更改也被无意中应用到了合奏代码文件夹中(我们目前拥有手动而不是自动测试的功能-很快将自动防止这种情况发生).我已经修复了该错误.
This bug was recently introduced by a bulk find/replace change of a class name made to the h2o R code. 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.
要修复,请从GitHub重新安装h2oEnsemble软件包:
To fix, reinstall the h2oEnsemble package from GitHub:
library(devtools)
install_github("h2oai/h2o-3/h2o-r/ensemble/h2oEnsemble-package")
感谢您的举报!为了更快地做出响应,请在此处发布错误和问题: https://groups.google.com/论坛/#!forum/h2ostream
Thanks for the report! For a quicker response, post bugs and questions here: https://groups.google.com/forum/#!forum/h2ostream
这篇关于h2oensemble值[[3L]](cond)中的错误:参数"training_frame"必须是有效的H2O H2OFrame或ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!