Generating random coupled matrix factorizations

Functions:

random_coupled_matrices(shapes, rank[, ...])

Generate a random coupled matrix decomposition (with non-negative entries)

matcouply.random.random_coupled_matrices(shapes, rank, full=False, random_state=None, normalise_factors=True, normalise_B=False, **context)[source]

Generate a random coupled matrix decomposition (with non-negative entries)

Parameters:
  • shapes (tuple) – A tuple where each element represents the shape of a matrix represented by the coupled matrix decomposition model. The second element in each shape-tuple must be constant.

  • rank (int or int list) – rank of the coupled matrix decomposition

  • full (bool, optional, default is False) – if True, a list of dense matrices is returned otherwise, the decomposition is returned

  • random_state (np.random.RandomState) –

Examples

Here is an example of how to generate a random coupled matrix factorization

>>> from matcouply.random import random_coupled_matrices
>>> shapes = ((5, 10), (6, 10), (7, 10))
>>> cmf = random_coupled_matrices(shapes, rank=4)
>>> print(cmf)
(weights, factors) : rank-4 CoupledMatrixFactorization of shape ((5, 10), (6, 10), (7, 10))