作者:濮阳土著_480 | 来源:互联网 | 2023-10-12 19:12
IamtryingtogetasparsematrixintoH2OandIwaswonderingwhetherthatwaspossible.Supposew
I am trying to get a sparse matrix into H2O and I was wondering whether that was possible. Suppose we have the following:
我试图将一个稀疏的矩阵变成H2O,我想知道这是否可能。假设我们有以下内容:
test <- Matrix(c(1,0,0,1,1,1,1,0,1), nrow = 3, sparse = TRUE)
and assuming my local H2O is localH2O
, I can't seem to do the following:
假设我的本地H2O是localH2O,我似乎无法做到以下几点:
as.h2o(test)
It gives the error: cannot coerce class "structure("dgCMatrix", package = "Matrix")" to a data.frame
. That seems to be pretty logical, however assuming that test is so big that I can't transform it into a dataframe, how am I suppose to load this into H2O? Using a sparse matrix representation it is only 500MB or so.
它给出了错误:不能将类“结构(”dgCMatrix“,package =”Matrix“)强制转换为data.frame。这看起来很合乎逻辑,但假设测试太大以至于无法将其转换为数据帧,我怎么想把它加载到H2O中呢?使用稀疏矩阵表示它只有500MB左右。
How can I load a sparse matrix into H2O?
如何将稀疏矩阵加载到H2O中?
1 个解决方案