Random_c (methods.seeding.random_c)

Random C [Albright2006] is inexpensive initialization method for nonnegative matrix factorization. It is inspired by the C matrix in of the CUR decomposition. The Random C initialization is similar to the Random Vcol method (see mod:methods.seeding.random_vcol) except it chooses p columns at random from the longest (in 2-norm) columns in target matrix (V), which generally means the most dense columns of target matrix.

Initialization of each column of basis matrix is done by averaging p random columns of l longest columns of target matrix. Initialization of mixture matrix is similar except for row operations.

class nimfa.methods.seeding.random_c.Random_c

Bases: object

initialize(V, rank, options)

Return initialized basis and mixture matrix. Initialized matrices are of the same type as passed target matrix.

Parameters:
  • V (One of the scipy.sparse sparse matrices types or or numpy.matrix) – Target matrix, the matrix for MF method to estimate.
  • rank (int) – Factorization rank.
  • options (dict) –

    Specify the algorithm and model specific options (e.g. initialization of extra matrix factor, seeding parameters).

    Option p_c represents the number of columns of target matrix used to average the column of basis matrix. Default value for p_c is 1/5 * (target.shape[1]).

    Option p_r represents the number of rows of target matrix used to average the row of basis matrix. Default value for p_r is 1/5 * (target.shape[0]).

    Option l_c represents the first l_c columns of target matrix sorted descending by length (2-norm). Default value for l_c is 1/2 * (target.shape[1]).

    Option l_r represent first l_r rows of target matrix sorted descending by length (2-norm). Default value for l_r is 1/2 * (target.shape[0]).