tags:

views:

195

answers:

3

Hi All, I asked a question before but duffymo said it is not clear so i am going to post it again here. I am using Jama api for SVD calculation. I know very well about jama and SVD. Jama does not work if your column are more than rows. I have this situation. What should I do?? any help? I can't transpose the matrix too as it can produce wrong results. Thanks.

P.S: I am calculating LSI with the help of jama. I am going like column(docs) and rows ( terms )

+1  A: 

Hi

If I understand correctly you are trying to compute the SVD of a matrix which is not square, and you have the library JAMA which only works on square matrices ? If I have understood you correctly then the answer to your question is obvious -- get a library which does compute SVD for non-square matrices. If I remember correctly Numerical Recipes contains such an algorithm, I expect you can find many other sources with Google.

Regards

Mark

High Performance Mark
Hi, Thanks for your reply. Yes you understand my problem 100% correctly. I couldn't find any good java API for SVD. can you please tell me one??? also jama is veyr slow it took 2 hours to calculate SVD on 500 column matrix
No, I can't help you with Java for SVD. But you should be able to find code written in other languages and call them from Java. A well-written library will probably help the speed problem too.
High Performance Mark
A: 

Why not use transpose? If X = USV', then X' = VS'U'. Right?

Transpose your matrix. Get U, S and V. Transpose everything back.

ahmadabdolkader
for LSI it should be term by document so you can not transpose
A: 

Since you're doing LSI, you could use SVDLIBJ, which is the Java equivalent of SVDLIBC, which is one of the most scalable SVD implementations that is freely available. The S-Space package has a command-line tool for SVDLIBJ set up already. Also, you can use their Matrix libraries and avoid the command-line if that fits your needs better.

David Jurgens