0

这个问题现在解决了吗?我遇到同样的错误信息。

用例:我正在使用 h2o 的deeplearning()函数进行二进制分类。下面,我提供了与我的实际用例大小相同的随机生成的数据。系统规格:

# R version 3.3.2 (2016-10-31)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows >= 8 x64 (build 9200)
# h2o version h2o_3.20.0.2

我目前正在学习如何使用 h2o,所以我已经玩过这个功能了。在我指定交叉验证的参数之前,一切都运行顺利。

指定nfolds交叉验证的参数时会出现问题。有趣的是,我可以为 nfolds 指定低值,一切都很好。对于我的用例,即使 nfolds > 3 也会产生错误消息(见下文)。我在下面提供了一个示例,在这里我可以指定 nfolds < 7(不是很一致……有时最多 nfolds = 3)。在这些值之上,REST API 会给出上述错误:object not found for argument: key.

# R version 3.3.2 (2016-10-31)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows >= 8 x64 (build 9200)
# h2o version h2o_3.20.0.2


#does not matter whether run on debian or windows, does not matter how many threads are used
#error occurs with options for cross validation, otherwise works fine
#no error occurs with specifying a low nfold number(in my actual use case, maximum of 3 folds possible without running into that error message)

require(h2o)
h2o.init(nthreads = -1)

x = matrix(rnorm(900*96, mean=10, sd=2), nrow=900, ncol=96)
y = sample(size=900, x=c(0,1), replace=T)

sampleData = cbind(x, y)
sampleData = data.frame(sampleData)
sampleData[,97] = as.factor(sampleData[,97])

m = h2o.deeplearning(x = 1:96, y = 97,
                     training_frame = as.h2o(sampleData), reproducible = T,
                     activation = "Tanh", hidden = c(64,16), epochs = 10000, verbose=T,
                     nfolds = 4, balance_classes = TRUE, #Cross-validation
                     standardize = TRUE, variable_importances = TRUE, seed=123,
                     stopping_rounds=2, stopping_metric="misclassification", stopping_tolerance=0.01, #early stopping
)

performance = h2o.performance(model = m)
print(performance)

######### gives error message
# ERROR: Unexpected HTTP Status code: 404 Not Found (url = http://localhost:xxxxx/3/Models/DeepLearning_model_R_1535036938222_489)
# 
# water.exceptions.H2OKeyNotFoundArgumentException
# [1] "water.exceptions.H2OKeyNotFoundArgumentException: Object 'DeepLearning_model_R_1535036938222_489' not found for argument: key"

我不明白为什么它只适用于 nfold 的低值。有什么建议么?我在这里想念什么?我在 Google Groups 和 stackoverflow 上搜索了最远程相关的线程,但没有成功。如果这与上述建议的 h2o 3.x 的更改 API 有关(尽管那篇文章是 18 个月前的……)我将非常感谢一些关于如何正确指定语法以使用 h2o.deeplearning 进行 CV 的纪录片( )。提前致谢!

4

1 回答 1

0

这是由于将verbose参数设置为 True 导致的错误,解决方法是将verbose参数保留为默认值,即FALSE. 我创建了一张 jira 票来跟踪这里的问题

于 2018-08-27T16:14:28.817 回答