This project has moved and is read-only. For the latest updates, please go here.

singular value decompositon runtime on a large matrix

Jan 21, 2012 at 4:50 PM


I'm doing a project in recommendation systems, and using the MovieLens ratings databse.

I need to calculate the SVD for different size Matrixes. I'm running the following code on matrixes of different sizes,and i have some questions:

Matrix mat = Matrix.Create(item.Value);//item value is Double[,]

DateTime dtStart = DateTime.Now;

SingularValueDecomposition temp = mat.SingularValueDecomposition; 

double runTime = (DateTime.Now - dtStart).TotalSeconds; 

1.First,i tried a 6040X503 Matrix. it succeeded, and the runtime was about 2 minutes. But another Matrix of 6040X471 just kept going and going and didn't finish.

The Matrixes are mostly zeroes.I wanted to know  what reasons could be for such a problem?

2. I divided the user databse, from 6040 to 4331 and 1709. I ran the same code,but now the matrix is 4331X503,and the SVD did'nt take less than 2 minutes,it didn't finish,which is odd,because the matrix is smaller,and before he did it faster. If anyone knows why this can happen,i would appreciate the help.

I'm using MathNet.Numerics.LinearAlgebra;

Thanks in advance,


Jan 21, 2012 at 7:55 PM

I believe that although I am not one of the developers, I can answer this question. SVD algorithms are essentially iterative algorithms that converge to the actual singular values. The time until convergence depends not only on the size of the matrix, but on many other properties. I believe that the long running times are due to the fact that the algorithm hasn't converged yet.