简体   繁体   English

bigmatrix:CreateFileBackedBigMatrix中的错误(as.character(backingfile),as.character(backingpath)

[英]bigmatrix: Error in CreateFileBackedBigMatrix(as.character(backingfile), as.character(backingpath)

After many hours of reading I found the best way to deal with big (really big matrix) in R is to use bigalgebra 经过几个小时的阅读后,我发现在R中处理大(非常大的矩阵)的最佳方法是使用bigalgebra

I want to store a large 80,000 x 80,000 matrix of 0s that doesn't fit in RAM and then replace its cells by the result of a large matrix multiplication. 我想存储一个大的80,000 x 80,000 0的矩阵,它不适合RAM,然后用大矩阵乘法的结果替换它的单元格。

I have this error 我有这个错误

Error in CreateFileBackedBigMatrix(as.character(backingfile), as.character(backingpath)
Problem creating filebacked matrix.

After doing 做完之后

my_matrix <- filebacked.big.matrix(ncol = ncol(Xt), nrow = nrow(X), 
                 type = "double", backingpath = getwd(), 
                 descriptorfile = "X.bin.desc", backingfile = "X.bin")

This is a reproducible similar case of my data 这是我的数据的可重现的类似情况

X <- matrix(rexp(200, rate=.1), ncol = 11, nrow = 80000)
Xt <- t(X)

So my full chunk is 所以我的全部内容是

library(bigalgebra)

X <- matrix(rexp(200, rate=.1), ncol = 11, nrow = 80000)
Xt <- t(X)

my_matrix <- filebacked.big.matrix(ncol = ncol(Xt), nrow = nrow(X), 
                 type = "double", backingpath = getwd(), 
                 descriptorfile = "X.bin.desc", backingfile = "X.bin")

However if I run this (not useful in my case) 但是如果我运行它(在我的情况下没用)

my_matrix <- filebacked.big.matrix(ncol = ncol(X), nrow = nrow(Xt), 
                 type = "double", backingpath = getwd(), 
                 descriptorfile = "X.bin.desc", backingfile = "X.bin")

it runs without warnings and stores a small 11 x 11 matrix. 它在没有警告的情况下运行并存储一个小的11 x 11矩阵。

I'm using OS El Capitan with 12 GB RAM and I'm aware that $X^t * X$ would need ~47 GB of RAM to compute, that's why I'm using bigalgebra to store that in the HDD. 我正在使用带有12 GB RAM的OS El Capitan,我知道$ X ^ t * X $需要~47 GB的RAM来计算,这就是为什么我使用bigalgebra将其存储在HDD中。

Check your available hard drive space, because the error you are signaling could be due to insufficient hard drive space to write down the backing-file necessary to the filebacked.big.matrix. 检查可用的硬盘空间,因为您发出的错误信号可能是由于硬盘空间不足而无法记下filebacked.big.matrix所需的后备文件。 I had your same error and I solved it by indicating an external hard drive as "backingpath". 我有同样的错误,我通过将外部硬盘指示为“backingpath”来解决它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM