2

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

值 [3L] 中的错误:参数“training_frame”必须是有效的 H2O H2OFrame 或 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` 只接受 H2OFrame 对象 - 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))
4

1 回答 1

3

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

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

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

感谢您的报告!要获得更快的响应,请在此处发布错误和问题:https ://groups.google.com/forum/#!forum/h2ostream

于 2015-12-17T04:17:26.243 回答