PyMF

Python Matrix Factorization Module
Download

PyMF Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL v3
  • Publisher Name:
  • Christian Thurau
  • Publisher web site:
  • http://code.google.com/u/cthurau/

PyMF Tags


PyMF Description

Python Matrix Factorization Module PyMF is a Python module for several constrained/unconstrained matrix factorization (and related) methods. The module is early alpha and not very well tested on all platforms. It is known to work well on recent Archlinux and Ubuntu Linux distributions running Python 2.6. In principle, it should also work for Windows/Mac users. If you find any bugs please send an e-mail to cthurau AT googlemail DOT com.PyMF currently includes the following methods:- Non-negative matrix factorization (NMF)- Convex non-negative matrix factorization (CNMF)- Semi non-negative matrix factorization (SNMF)- Archetypal analysis (AA)- Simplex volume maximization (SiVM)- Convex-hull non-negative matrix factorization (CHNMF)- Binary matrix factorization (BNMF)- Singular value decomposition (SVD)- Principal component analysis (PCA)- K-means clustering (Kmeans)- CUR decomposition (CUR)- Compaxt matrix decomposition (CMD) Given a dataset, most factorization methods try to minimize the Frobenius norm | data - W*H | by finding a suitable set of basis vectors W and coefficients H. The syntax for calling the various methods is quite similar. Usually, one has to submit a desired number of basis vectors and the maximum number of iterations. For example, applying NMF to a dataset data aiming at 2 basis vectors within 10 iterations works as follows:>>> import pymf>>> import numpy as np>>> data = np.array(, ])>>> nmf_mdl = pymf.NMF(data, num_bases=2, niter=10)>>> nmf_mdl.initialization()>>> nmf_mdl.factorize()The basis vectors are now stored in nmf_mdl.W, the coefficients in nmf_mdl.H. To compute coefficients for an existing set of basis vectors simply copy W to nmf_mdl.W, and set compW to False:>>> data = np.array(, ])>>> W = np.array(, ])>>> nmf_mdl = pymf.NMF(data, num_bases=2, niter=1, compW=False)>>> nmf_mdl.initialization()>>> nmf_mdl.W = W>>> nmf_mdl.factorize()By changing pymf.NMF to e.g. pymf.AA or pymf.CNMF Archetypal Analysis or Convex-NMF can be applied. Some methods might allow other parameters, make sure to have a look at the corresponding >>>help(pymf.AA) documentation. For example, CUR, CMD, and SVD are handled slightly differently, as they factorize into three submatrices which requires appropriate arguments for row and column sampling. Requirements: · Python · NumPy · CVXOPT · SciPy


PyMF Related Software