I have a sparse matrix in R
I now wish to perform nonnegative matrix factorization on R
data.txt is a text file i created using python, it consists of 3 columns where first column specifies the row number, second the column number and third the value
data.txt
1 5 10
3 2 5
4 6 9
original data.txt contains 164009 rows which is data for 250000x250000 sparse matrix
I used NMF library and I am doing
x=scan('data.txt',what=list(integer(),integer(),numeric()))
library('Matrix')
R=sparseMatrix(i=x[[1]],j=x[[2]],x=x[[3]])
res<-nmf(R,3)
It is giving me an error:
Error in function (classes, fdef, mtable): unable to find an inherited method for function nmf, for signature "dgCMAtrix", "missing", "missing"
Could anyone help me figure out what am I doing wrong?
data.txt
would have, it's that providing a reproducible example lowers the barrier to providing questions enormously; rather than starting by constructing an example, would-be answerers can start right in on diagnosing/answering the question. Meet them halfway: tinyurl.com/reproducible-000 - Ben Bolker