ristretto - Python矩阵随机降维库
Randomized Dimension Reduction Library
Python 机器学习
共80Star
详细介绍
The idea of randomized low-rank matrix approximations is to restrict the high-dimensional input data matrix to a low-dimensional space. In plain words, the aim is to find a smaller matrix which captures the essential information of the input matrix. This smaller matrix can then be used to extract (learn) the coherent structure of the data. Probabilistic algorithms considerably reduce the computational demands of traditional (deterministic) algorithms, and the computational advantage becomes pronounced with increasing matrix dimensions.
The Python software library ristretto provides a collection of randomized matrix algorithms which can be used for dimension reduction. Overview of implemented routines:
- Randomized singular value decomposition:
from ristretto.svd import compute_rsvd
. - Randomized interpolative decomposition:
from ristretto.interp_decomp import compute_rinterp_decomp
. - Randomized CUR decomposition:
from ristretto.cur import compute_rcur
. - Randomized LU decompositoin:
from ristretto.lu import compute_rlu
. - Randomized nonnegative matrix factorization:
from ristretto.nmf import compute_rnmf_fhals
.
Get started
Obtaining the Latest Software via GIT
To get the latest stable and development versions of ristretto run:
$ git clone https://github.com/erichson/ristretto
Then, to build and install the package, run from within the main directory in the release:
$ python setup.py install
Note you will need the following 3rd party packages installed in your environment:
- numpy
- scipy
- Cython
- scikit-learn
- nose
After successfully installing the ristretto library, the unit tests can be run by:
$ python setup.py test
References
- N. Benjamin Erichson, et al. 'Randomized Matrix Decompositions using R.' (2016)
- Sergey Voronin, Per-Gunnar Martinsson. 'RSVDPACK: Subroutines for computing partial singular value decompositions via randomized sampling on single core, multi core, and GPU architectures.' (2015)
- Nathan Halko, et al. 'Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions.' (2011)