【问题标题】:H2O can not subset columns from the H2OParsedDataH2O 不能从 H2OParsedData 中子集列
【发布时间】:2015-07-01 23:09:56
【问题描述】:

我将 h2o(2.8.4.4) 用于 R 中的 hadoop。 我想从具有 720512 行和 788 列的数据框中获取一些列。 我写的是这样的:

library("h2o");
localH2O = h2o.init(ip = ipItem, port = 54321, startH2O = F)
waterTrain <- h2o.importFile(localH2O, path=trainName, key="trainKey", parse=T, header=T, sep="*")
subset <- waterTrain[, 1:787]
Error: Expectation failed

我做错了什么?

【问题讨论】:

    标签: r hadoop h2o


    【解决方案1】:

    您可以使用 as.data.frame 方法将 waterTrain 转换为数据框,然后使用标准 R 方法方便地过滤(子集)

    waterTrain.data.frame <- as.data.frame(waterTrain)
    

    你也可以,

    irisPath <- system.file("extdata", "iris.csv", package="h2o")
    iris.hex <- h2o.importFile(localH2O, path = irisPath, key = "iris.hex")
    iris.hex.top10 <- iris.hex[1:10,1:3]
    

    【讨论】:

    • 感谢您的帮助。但我想使用h2o.gbm。它仅适用于 h2o 解析的数据。我遇到了同样的错误。
    猜你喜欢
    • 2018-07-27
    • 2015-01-26
    • 2018-01-31
    • 1970-01-01
    • 2016-11-21
    • 1970-01-01
    • 1970-01-01
    • 2022-12-10
    • 1970-01-01
    相关资源
    最近更新 更多