This code implements a matrix completion and decomposition algorithm, based on this paper.
The main method you will want to use is
matrix_decomposition() which decomposes an optionally incomplete matrix, into two components, one low rank, and one sparse. It takes the following arguments:
Y: the matrix to decompose.
Yis assumed to be equal to
TH + GA + W, where
THis an approximately low rank matrix,
GAis a sparse "spiky" matrix, and
Wis noise. A full matrix needs to be given, but some parts can be ignored, as specified by the mask.
Mask: a mask can be given to treat the matrix as incomplete. It must be of the same dimentions as
Y. It must have
Falsein the positions where
Trueelsewhere. Defaults to
lambda_d: regularization paramater for the low rank
mu_d: regularization parameter for the sparse
GAmatrix. Use higher values if no spikes are expected.
alpha: parameter that limits the maximum element of the low rank TH matrix. Bigger matrices will need bigger alpha` values.
The method will return
Additionally the code contains some methods and classes to generate synthetic matrices and to test the decomposition in various ways.