sparsesvd

Python module that wraps SVDLIBC, a library for sparse Singular Value Decomposition
Download

sparsesvd Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Other/Proprietary Li...
  • Publisher Name:
  • Radim Rehurek
  • Publisher web site:
  • http://nlp.fi.muni.cz

sparsesvd Tags


sparsesvd Description

Python module that wraps SVDLIBC, a library for sparse Singular Value Decomposition sparsesvd is a Python wrapper around the SVDLIBC library written by Doug Rohde, which is itself based on Michael Berry's SVDPACK.sparsesvd uses SciPy's sparse CSC (Compressed Sparse Column) matrix format as input to SVD. This is the same format used internally by SVDLIBC, so that no extra data copies need to be made by the Python wrapper.InstallationThe simple way to install sparsesvd is:sudo easy_install sparsesvdOr, if you have instead downloaded and unzipped the source tar.gz package, you'll need to run:python setup.py testsudo python setup.py installThis version has been tested under Python 2.5 and 2.6, but should run on any 2.5 >> import numpy, scipy.sparse>>> from sparsesvd import sparsesvd>>> mat = numpy.random.rand(200, 100) # create a random matrix>>> smat = scipy.sparse.csc_matrix(mat) # convert to sparse CSC format>>> ut, s, vt = sparsesvd(smat, 100) # do SVD, asking for 100 factors>>> assert numpy.allclose(mat, numpy.dot(ut.T, numpy.dot(numpy.diag(s), vt)))Original wrapper by Lubos Kardos, package maintained by Radim Rehurek. Requirements: · Python · NumPy · SciPy


sparsesvd Related Software