I apologize for threadjacking but you guys might be able to help. I have a different problem - I would like to compute an approximate SVD of a very large sparse matrix, (for spectral clustering) but I can't find a good implementation which works for datasets too large to fit in core. This is a hadoop scale problem. What's the best way to do this? Of course, finding all the singular values/vectors is out of the questi…
Distributed, Large-Scale Latent Semantic Analysis by Index Interpolation. Sebastiano Vigna http://tinyurl.com/d99779 [PDF]
Ask HN: what linear algebra do you use most often for practical problems?
11–20 of 31 posts
Re: Ask HN: what linear algebra do you use most often for practical problems?
#12I'm currently looking for a good Partial Least Squares algorithm in C/C++. Any suggestions? I know R has a popular PLS algorithm, but I was hoping to avoid the learning curve.
Re: Ask HN: what linear algebra do you use most often for practical problems?
#13I apologize for threadjacking but you guys might be able to help. I have a different problem - I would like to compute an approximate SVD of a very large sparse matrix, (for spectral clustering) but I can't find a good implementation which works for datasets too large to fit in core. This is a hadoop scale problem. What's the best way to do this? Of course, finding all the singular values/vectors is out of the questi…
As long as the 100 vectors fit in memory, it shouldn't be too bad. I think the commonly used algorithm to find the first singular vectors is Lanczos iteration, where the key operation is multiplying the 100 vectors by the large matrix. I don't know if there's an existing library for this though...
I've used this, it works pretty quickly and produces exact results, unlike a gradient descent approach. Unfortunately, assuming I did everything correctly, it doesn't ignore the zeros in the data. I think this because after centering the data (subtracting the mean and dividing by the standard deviation for each row in the matrix), it just doesn't finish. I must have left it running for two days before I gave up on it. My assumption is that it was trying to approximate all the zeros which, due to centering, now were seen as the average rating for that user. I'm sure you could modify it to ignore those values, though.
edit: Please note that I could be way off in that my interpretation of the program not finishing. If someone knows I'm wrong, please tell me.
Re: Ask HN: what linear algebra do you use most often for practical problems?
#14I apologize for threadjacking but you guys might be able to help. I have a different problem - I would like to compute an approximate SVD of a very large sparse matrix, (for spectral clustering) but I can't find a good implementation which works for datasets too large to fit in core. This is a hadoop scale problem. What's the best way to do this? Of course, finding all the singular values/vectors is out of the questi…
You just have to provide a matrix-vector product function, specify a few parameters (how many singular values to find, should it compute the singular vectors, maximum number of iterations, etc) and it takes care of the rest. It uses the Lanczos iteration approach mentioned in sibling comments, and it seems like a far nicer implementation than SVDPACK and SVDLIBC.
Let me know if you want a copy of my C interface to PROPACK.
Re: Ask HN: what linear algebra do you use most often for practical problems?
#15I apologize for threadjacking but you guys might be able to help. I have a different problem - I would like to compute an approximate SVD of a very large sparse matrix, (for spectral clustering) but I can't find a good implementation which works for datasets too large to fit in core. This is a hadoop scale problem. What's the best way to do this? Of course, finding all the singular values/vectors is out of the questi…
Gradient descent is a good solution for approximate SVD, I'm using it as part of my data mining final project (working on the netflix prize). I'm using this guy's code: http://www.timelydevelopment.com/demos/NetflixPrize.aspx , modified to print out the singular vectors when it finishes. It took about 32 hours (can't quite remember) to find the first 64 singular values* on the netflix dataset (480000x18000, 1.2% non-…
Re: Ask HN: what linear algebra do you use most often for practical problems?
#16Re: Ask HN: what linear algebra do you use most often for practical problems?
#17You can save a ton of time by formulating a linear algebra problem as a shortest path problem; you can end up using dijkstra's algorithm to enumerate the possible solutions. http://en.wikipedia.org/wiki/Knapsack_problem
Re: Ask HN: what linear algebra do you use most often for practical problems?
#18Earlier quoted context omitted.
As long as the 100 vectors fit in memory, it shouldn't be too bad. I think the commonly used algorithm to find the first singular vectors is Lanczos iteration, where the key operation is multiplying the 100 vectors by the large matrix. I don't know if there's an existing library for this though...
There is indeed, http://tedlab.mit.edu/~dr/svdlibc/ this is a sparse svd solver using the Lanczos approach. I've used this, it works pretty quickly and produces exact results, unlike a gradient descent approach. Unfortunately, assuming I did everything correctly, it doesn't ignore the zeros in the data. I think this because after centering the data (subtracting the mean and dividing by the standard deviation for each…
Re: Ask HN: what linear algebra do you use most often for practical problems?
#19I apologize for threadjacking but you guys might be able to help. I have a different problem - I would like to compute an approximate SVD of a very large sparse matrix, (for spectral clustering) but I can't find a good implementation which works for datasets too large to fit in core. This is a hadoop scale problem. What's the best way to do this? Of course, finding all the singular values/vectors is out of the questi…
I've been using PROPACK lately to perform SVD on a gigantic matrix, and it kicks ass. It's a fortran and/or MATLAB package for SVD of large sparse or "structured" matrices. http://soi.stanford.edu/~rmunk/PROPACK/ You just have to provide a matrix-vector product function, specify a few parameters (how many singular values to find, should it compute the singular vectors, maximum number of iterations, etc) and it takes…
Cheers
Re: Ask HN: what linear algebra do you use most often for practical problems?
#20I'm using SVD in building a porn recommendation engine. (Very NSFW, and the recommendation engine itself isn't live yet: http://fapseek.com )