Need help with nimfa?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

464 Stars 128 Forks Other 560 Commits 10 Opened issues


Nimfa: Nonnegative matrix factorization in Python

Services available


Need anything else?

Contributors list


build: passing build: passing GitHub release BSD license Conda Version

Nimfa is a Python module that implements many algorithms for nonnegative matrix factorization. Nimfa is distributed under the BSD license.

The project was started in 2011 by Marinka Zitnik as a Google Summer of Code project, and since then many volunteers have contributed. See AUTHORS file for a complete list of contributors.

It is currently maintained by a team of volunteers.

[News:] Scikit-fusion, collective latent factor models, matrix factorization for data fusion and learning over heterogeneous data.

[News:] fastGNMF, fast implementation of graph-regularized non-negative matrix factorization using Facebook FAISS.

Important links

  • Official source code repo:
  • HTML documentation (stable release):
  • Download releases:
  • Issue tracker:


Nimfa is tested to work under Python 2.7 and Python 3.4.

The required dependencies to build the software are NumPy >= 1.7.0, SciPy >= 0.12.0.

For running the examples Matplotlib >= 1.1.1 is required.


This package uses setuptools, which is a common way of installing python modules. To install in your home directory, use:

python install --user

To install for all users on Unix/Linux:

sudo python install

For more detailed installation instructions, see the web page

Alternatively, you may also install this package using conda:

conda install -c conda-forge nimfa


Run alternating least squares nonnegative matrix factorization with projected gradients and Random Vcol initialization algorithm on medulloblastoma gene expression data:

>>> import nimfa
>>> V =
>>> lsnmf = nimfa.Lsnmf(V, seed='random_vcol', rank=50, max_iter=100)
>>> lsnmf_fit = lsnmf()
>>> print('Rss: %5.4f' %
Rss: 0.2668
>>> print('Evar: %5.4f' %
Evar: 0.9997
>>> print('K-L divergence: %5.4f' % lsnmf_fit.distance(metric='kl'))
K-L divergence: 38.8744
>>> print('Sparseness, W: %5.4f, H: %5.4f' %
Sparseness, W: 0.7297, H: 0.8796


  title     = {Nimfa: A Python Library for Nonnegative Matrix Factorization},
  author    = {Zitnik, Marinka and Zupan, Blaz},
  journal   = {Journal of Machine Learning Research},
  volume    = {13},
  pages     = {849-853},
  year      = {2012}

Selected publications (Methods)

  • Data fusion by matrix factorization:
  • Jumping across biomedical contexts using compressive data fusion:
  • Survival regression by data fusion:
  • Gene network inference by fusing data from diverse distributions:
  • Fast optimization of non-negative matrix tri-factorization:

Selected publications (Applications)

  • A comprehensive structural, biochemical and biological profiling of the human NUDIX hydrolase family:
  • Gene prioritization by compressive data fusion and chaining:
  • Discovering disease-disease associations by fusing systems-level molecular data:
  • Matrix factorization-based data fusion for gene function prediction in baker's yeast and slime mold:
  • Matrix factorization-based data fusion for drug-induced liver injury prediction:
  • Collective pairwise classification for multi-way analysis of disease and drug data:


  • Hidden Genes: Understanding cancer data with matrix factorization, ACM XRDS: Crossroads: [Jupyter Notebook]

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.