public Matrix computeSVD ( Matrix sparse_matrix , int dimensions ) { try { File rawTermDocMatrix = File . createTempFile ( "lra-term-document-matrix" , ".dat" ) ; MatrixIO . writeMatrix ( sparse_matrix , rawTermDocMatrix , MatrixIO . Format . SVDLIBC_SPARSE_TEXT ) ; MatrixFile mFile = new MatrixFile ( rawTermDocMatrix , MatrixIO . Format . SVDLIBC_SPARSE_TEXT ) ; reducer . factorize ( mFile , dimensions ) ; return reducer . dataClasses ( ) ; } catch ( IOException ioe ) { throw new IOError ( ioe ) ; } }
Does the Singular Value Decomposition using the generated sparse matrix . The dimensions used cannot exceed the number of columns in the original matrix .