如何将r数据帧转换为h2o对象 [英] How to convert r data frame to h2o object

查看:339
本文介绍了如何将r数据帧转换为h2o对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于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)

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

解决方案

请尝试:

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

Im new to R and H2O and I have tried to find a way to convert r data frame to a h2o object. I have spent some time research on how to do this with no luck. Other way around is possible and well documented as follows.

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

But what i want is complete opposite of this. I wants to convert r "prostate.data.frame" data object converted to h2o object named "prostate.hex". Thanks in advance.

解决方案

Please try this:

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

这篇关于如何将r数据帧转换为h2o对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆