1

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 )

user238384
  • 2,396
  • 10
  • 35
  • 36

4 Answers4

1

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.

user229044
  • 232,980
  • 40
  • 330
  • 338
High Performance Mark
  • 77,191
  • 7
  • 105
  • 161
  • 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 – user238384 Jan 31 '10 at 17:13
1

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

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

Ahmed Abdelkader
  • 1,695
  • 1
  • 13
  • 12
0

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
  • 304
  • 1
  • 8
0

I now it is a really late reply . But i thought it is better late than never

But i am aware that jblas performs svd in a effective manner.

CTsiddharth
  • 907
  • 12
  • 21