stnmf.init.nnsvdlrc
- stnmf.init.nnsvdlrc(v, r, lrc=True, dtype='float32')
Initialize feature matrix with a variation of non-negative singular value decomposition with low-rank correction (NNSVD-LRC)
For details on NNSVD-LRC [1] and its modifications to the algorithm see notes below.
- Parameters:
v (
(n,m) array_like) – Input matrixr (
int) – Number of componentslrc (
dictorbool, optional) – Perform subsequent low-rank correction as matrix factorization on the low-rank approximation v to improve the initial features w. This is considered computationally cheaper than factorization on the full v. If lrc is True, use default parameters for creating a MF object, with one iteration and method ‘SparseSemiNMF’. If dict, it serves as keyword arguments for initialization of the MF object, incl. num_iter. See stnmf.MF for details.dtype (
strortype, optional) – Number format with which to calculate. Default is ‘float32’
- Returns:
w (
(n,r) numpy.ndarray) – Initialized w
Notes
Since the input matrix v is not non-negative in a semi-NMF/MF problem, the first rank-one factor of the SVD is not exclusively positive, but may contain positive and negative values. Therefore, step 2 in the algorithm of [1] is skipped here and step 3 is performed on all r rank-one factors. Additionally, unlike in [1], only w is initialized, as h is to be inferred subsequently.
References