P
Patricia Shanahan
In one of my programs, I use truncated singular value decomposition of a
matrix of doubles. In current tests, the matrix has about 20,000 rows
and 200 columns, but future tests may need more rows and more columns.
The matrix is sparse, and in Java is represented by a list of triples,
effectively (row, column, value). I can limit the result size by
truncating at a few dozen singular values.
My current quick hack solution is to write the triples to a temporary
file and exec Matlab to do the decomposition. All computers on which I
need to run this have Matlab installed. However, it is installed at
different places on different computers, so I use an environment
variable containing the Matlab executable path.
This works, and is quite quick even for the largest of my current test
cases. However, a pure Java solution might be cleaner and easier to manage.
JAMA, http://math.nist.gov/javanumerics/jama/, and Jampack,
ftp://math.nist.gov/pub/Jampack/Jampack/AboutJampack.html, both offer SVD.
Does anyone have any experience with them, especially for sparse matrix
truncated SVD? Recommendations on which to try first, if either? Other
options? Performance comparisons to Matlab?
Patricia
matrix of doubles. In current tests, the matrix has about 20,000 rows
and 200 columns, but future tests may need more rows and more columns.
The matrix is sparse, and in Java is represented by a list of triples,
effectively (row, column, value). I can limit the result size by
truncating at a few dozen singular values.
My current quick hack solution is to write the triples to a temporary
file and exec Matlab to do the decomposition. All computers on which I
need to run this have Matlab installed. However, it is installed at
different places on different computers, so I use an environment
variable containing the Matlab executable path.
This works, and is quite quick even for the largest of my current test
cases. However, a pure Java solution might be cleaner and easier to manage.
JAMA, http://math.nist.gov/javanumerics/jama/, and Jampack,
ftp://math.nist.gov/pub/Jampack/Jampack/AboutJampack.html, both offer SVD.
Does anyone have any experience with them, especially for sparse matrix
truncated SVD? Recommendations on which to try first, if either? Other
options? Performance comparisons to Matlab?
Patricia