1
$\begingroup$

I am looking for a library/package/code to do thin SVD in Java. I found a good implementation of SVD in the COLT package for java, but that's not sufficiently robust with large sparse matrices when only a small number of singular vectors is desired. Any ideas?

$\endgroup$
2
$\begingroup$

Have a look at Apache Mahout. It has various dimensionality reduction techniques implemented.

$\endgroup$
  • $\begingroup$ Apache Mahout could work, at least according to the bin/mahout svd command. It is very unfortunate they don't have a simple example how to do svd programmatically. $\endgroup$ – svder Jan 6 '12 at 18:59
  • $\begingroup$ on a second look, there is this class: search-lucene.com/jd/mahout/math/org/apache/mahout/math/… but it does not seem like it provides a thin SVD. It does SVD for the whole matrix, without an ability to bound the number of singular vectors returned (for efficiency). COLT does that as well. In fact, this class is very similar to the COLT class for SVD: acs.lbl.gov/software/colt/api/cern/colt/matrix/linalg/… $\endgroup$ – svder Jan 6 '12 at 19:02
  • $\begingroup$ From lurking on their mailing list, I know that the Mahout team is very interested in techniques that only get at the first N dimensions. Perhaps their LanczosSolver code is what you're looking for? In any case, try to send mail to user@mahout.apache.org. $\endgroup$ – Jack Tanner Jan 6 '12 at 23:00
2
$\begingroup$

For a small number of PCs, the choice algorithm seems to be Nipals.

$\endgroup$
  • $\begingroup$ The NIPALS algorithm is often used in sparse PLS regression. Do you have other applications in mind? Specifically, how would NIPALS alone address the sparsity problem? $\endgroup$ – chl Jan 7 '12 at 11:31
  • $\begingroup$ As Nipals iterates matrix multiplication of a vector (+ renormalizations) until convergence to singular vectors: you may use fast sparse matrix multiplication for the case of sparse matrices. But I confess that the stimulus that lead me to the Nipals reflex was "only a small numbers of singular vectors is desired". $\endgroup$ – Elvis Jan 7 '12 at 13:03
  • $\begingroup$ Ah, I see. I am not aware of papers specifically concerned with that approach, only work that has been done with L1 and/or L2 regularization in PLS or CCA. $\endgroup$ – chl Jan 7 '12 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.