Simulated studies (examples.synthetic)

This module contains examples of factorization runs. Since the data is artificially generated, this is not a valid test of models applicability to real world situations. It can however be used for demonstration of the library.

Examples are performed on 20 x 30 dense matrix, whose values are drawn from normal distribution with zero mean and variance of one (an absolute of values is taken because of nonnegativity constraint).

Only for the purpose of demonstration in all examples many optional (runtime or algorithm specific) parameters are set. The user could as well run the factorization by providing only the target matrix. In that case the defaults would be used. General model parameters are explained in nimfa.mf_run, algorithm specific parameters in Python module implementing the algorithm. Nevertheless for best results, careful choice of parameters is recommended. No tracking is demonstrated here.

Note

For most factorizations using artificially generated data is not the intended usage (e. g. SNMNMF is in [Zhang2011] used for identification of the microRNA-gene regulatory networks). Consider this when discussing convergence and measurements output.

To run the examples simply type:

python synthetic.py

or call the module’s function:

import nimfa.examples
nimfa.examples.synthetic.run()
nimfa.examples.synthetic.print_info(fit, idx=None)

Print to stdout info about the factorization.

Parameters:
  • fit (nimfa.models.mf_fit.Mf_fit) – Fitted factorization model.
  • idx (str with values ‘coef’ or ‘coef1’ (int value of 0 or 1, respectively)) – Name of the matrix (coefficient) matrix. Used only in the multiple NMF model. Therefore in factorizations that follow standard or nonsmooth model, this parameter can be omitted. Currently, SNMNMF implements multiple NMF model.
nimfa.examples.synthetic.run(V=None, V1=None)

Run examples.

Parameters:
  • V (numpy.matrix) – Target matrix to estimate.
  • V1 (numpy.matrix) – (Second) Target matrix to estimate used in multiple NMF (e. g. SNMNMF).
nimfa.examples.synthetic.run_bd(V)

Run Bayesian decomposition.

Parameters:V (numpy.matrix) – Target matrix to estimate.
nimfa.examples.synthetic.run_bmf(V)

Run binary matrix factorization.

Parameters:V (numpy.matrix) – Target matrix to estimate.
nimfa.examples.synthetic.run_icm(V)

Run iterated conditional modes.

Parameters:V (numpy.matrix) – Target matrix to estimate.
nimfa.examples.synthetic.run_lfnmf(V)

Run local fisher nonnegative matrix factorization.

Parameters:V (numpy.matrix) – Target matrix to estimate.
nimfa.examples.synthetic.run_lsnmf(V)

Run least squares nonnegative matrix factorization.

Parameters:V (numpy.matrix) – Target matrix to estimate.
nimfa.examples.synthetic.run_nmf(V)

Run standard nonnegative matrix factorization.

Parameters:V (numpy.matrix) – Target matrix to estimate.
nimfa.examples.synthetic.run_nsnmf(V)

Run nonsmooth nonnegative matrix factorization.

Parameters:V (numpy.matrix) – Target matrix to estimate.
nimfa.examples.synthetic.run_pmf(V)

Run probabilistic matrix factorization.

Parameters:V (numpy.matrix) – Target matrix to estimate.
nimfa.examples.synthetic.run_psmf(V)

Run probabilistic sparse matrix factorization.

Parameters:V (numpy.matrix) – Target matrix to estimate.
nimfa.examples.synthetic.run_sepnmf(V)

Run standard nonnegative matrix factorization.

Parameters:V (numpy.matrix) – Target matrix to estimate.
nimfa.examples.synthetic.run_snmf(V)

Run sparse nonnegative matrix factorization.

Parameters:V (numpy.matrix) – Target matrix to estimate.
nimfa.examples.synthetic.run_snmnmf(V, V1)

Run sparse network-regularized multiple NMF.

Parameters:
  • V (numpy.matrix) – First target matrix to estimate.
  • V1 (numpy.matrix) – Second target matrix to estimate.