将R数据帧转换为H2O帧而无需写入磁盘 [英] Converting R dataframe to H2O Frame without writing to disk

查看:74
本文介绍了将R数据帧转换为H2O帧而无需写入磁盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 h2o 库中的as.h2o函数将R data.frame转换为H2O帧.两个问题:

I know the as.h2o function from h2o library converts an R data.frame to an H2O frame. Two questions:

  1. as.h2o()是否在转换期间将数据写入磁盘?该数据存储多长时间?
  2. 还有其他选择可以避免临时写入磁盘的步骤吗?
  1. Does as.h2o() write data to disk during conversion? How long is this data stored?
  2. Are there other options that avoids the temp step of writing to disk?

推荐答案

在data.frame,df上运行as.h2o的确切路径:

The exact path of running as.h2o on a data.frame, df :

path <- write.csv(df)
h2o.upload(path)
remove.file(path)

我们将data.frame临时写入磁盘,然后上传而不是将文件导入到H2O中,一旦文件上传,我们就会删除该临时帧.除了不写磁盘,没有其他更干净的选择.

We temporarily write to disk the data.frame and then subsequently upload rather than import the file into H2O and as soon as the file is uploaded we delete the temporary frame. There is no cleaner alternative to not writing to disk.

这篇关于将R数据帧转换为H2O帧而无需写入磁盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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