【问题标题】:How to convert r data frame to h2o object如何将 r 数据框转换为 h2o 对象
【发布时间】:2015-02-17 15:22:34
【问题描述】:

我是 R 和 H2O 的新手,我试图找到一种将 r 数据框转换为 h2o 对象的方法。我花了一些时间研究如何在没有运气的情况下做到这一点。其他方法也是可能的,并且有如下详细记录。

prosPath = system.file("extdata", "prostate.csv", package="h2o")
prostate.hex = h2o.importFile(localH2O, path = prosPath)
prostate.data.frame <- as.data.frame(prostate.hex)

但我想要的完全相反。我想将 r“prostate.data.frame”数据对象转换为名为“prostate.hex”的 h2o 对象。 提前致谢。

【问题讨论】:

    标签: r dataframe h2o


    【解决方案1】:

    请试试这个:

    prostate.hex <- as.h2o(localH2O, prostate.data.frame, key="prostate.hex")
    

    【讨论】:

    【解决方案2】:

    目前接受的答案已过时(2016 年 1 月 22 日),所以这是目前有效的答案

    prostate.hex <- as.h2o(prostate.data.frame, destination_frame="prostate.hex")
    

    【讨论】:

      【解决方案3】:

      根据 h2o 版本 3.6.0.8,它不需要任何参数。示例:

      iris.hex <- as.h2o(iris)
      

      【讨论】:

      • 我们为什么要附加一个 .hex?
      猜你喜欢
      • 2015-10-05
      • 1970-01-01
      • 1970-01-01
      • 2011-05-21
      • 2011-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多