mc_algorithms

spalor.algorithms.mc_algorithms.alt_min(m, n, r, Omega, known)[source]

A very simple algorithm for matrix completion via alternating minimization.

Parameters
  • m (int) – number or rows in matrix

  • n (int) – number of columns in matrix

  • Omega (np array) – array with 2 columns and many rows, indicating indices of the matrix you have a measurement of

  • known (np array) – vector of measurements, in same order as ‘known’

spalor.algorithms.mc_algorithms.alt_proj(m, n, r, X, y)[source]
A very simple matrix completion algorithm comprising of two steps at each iteration:
  • project L onto set of matrices satisfying the measurements

  • project L onto the set of rank r matrices

Parameters
  • m (int) – number or rows in matrix

  • n (int) – number of columns in matrix

  • r (int) – target rank of matrix.

  • X (np array) – array with 2 columns and many rows, indicating indices of the matrix you have a measurement of

  • y (np array) – vector of measurements, in same order as ‘known’

References

2

Tanner, J., & Wei, K. (2013). Normalized iterative hard thresholding for matrix completion. SIAM Journal on Scientific Computing, 35(5), S104-S125.

spalor.algorithms.mc_algorithms.lmafit(d1, d2, r, known, data)[source]

A rank-constrained matrix completion algorithm that uses a successive over-relaxation scheme.

Links for more details: - http://lmafit.blogs.rice.edu/

Parameters
  • d1 (int) – number or rows in matrix

  • d2 (int) – number of columns in matrix

  • r (int) – target rank of matrix.

  • known (np array) – array with 2 columns and many rows, indicating indices of the matrix you have a measurement of

  • data (np array) – vector of measurements, in same order as ‘known’

References

1

Wen, Z., Yin, W. & Zhang, Y. Solving a low-rank factorization model for matrix completion by a nonlinear successive over-relaxation algorithm. Math. Prog. Comp. 4, 333–361 (2012). https://doi.org/10.1007/s12532-012-0044-1

spalor.algorithms.mc_algorithms.svt(m, n, beta_max, known, data, eps=1e-05, r_max=None)[source]

Singular value thresholding for matrix completion

Parameters
  • m (int) – number or rows in matrix

  • n (int) – number of columns in matrix

  • beta_max (float) – largest singular value to keep. Larger values mean less regularization, and less estimtor bias

  • known (np array) – array with 2 columns and many rows, indicating indices of the matrix you have a measurement of

  • data (np array) – vector of measurements, in same order as ‘known’

  • eps (float) – stopping criteria. (default: 1e-5)

  • r_max (int) – upper bound on the rank of the matrix. The smaller this is, the faster the algorithm will be

References

3

Cai, J. F., Candès, E. J., & Shen, Z. (2010). A singular value thresholding algorithm for matrix completion. SIAM Journal on optimization, 20(4), 1956-1982.