mlpack
master
|
This class implements the popular nuclear norm minimization heuristic for matrix completion problems. More...
Public Member Functions | |
MatrixCompletion (const size_t m, const size_t n, const arma::umat &indices, const arma::vec &values, const size_t r) | |
Construct a matrix completion problem, specifying the maximum rank of the solution. More... | |
MatrixCompletion (const size_t m, const size_t n, const arma::umat &indices, const arma::vec &values, const arma::mat &initialPoint) | |
Construct a matrix completion problem, specifying the initial point of the optimization. More... | |
MatrixCompletion (const size_t m, const size_t n, const arma::umat &indices, const arma::vec &values) | |
Construct a matrix completion problem. More... | |
void | Recover (arma::mat &recovered) |
Solve the underlying SDP to fill in the remaining values. More... | |
const optimization::LRSDP< optimization::SDP< arma::sp_mat > > & | Sdp () const |
Return the underlying SDP. More... | |
optimization::LRSDP< optimization::SDP< arma::sp_mat > > & | Sdp () |
Modify the underlying SDP. More... | |
Private Member Functions | |
void | CheckValues () |
Validate the input matrices. More... | |
void | InitSDP () |
Initialize the SDP. More... | |
Static Private Member Functions | |
static size_t | DefaultRank (const size_t m, const size_t n, const size_t p) |
Select a rank of the matrix given that is of size m x n and has p known elements. More... | |
Private Attributes | |
arma::umat | indices |
Matrix containing the indices of the known entries (has two rows). More... | |
size_t | m |
Number of rows in original matrix. More... | |
size_t | n |
Number of columns in original matrix. More... | |
optimization::LRSDP< optimization::SDP< arma::sp_mat > > | sdp |
The underlying SDP to be solved. More... | |
arma::mat | values |
Vector containing the values of the known entries. More... | |
This class implements the popular nuclear norm minimization heuristic for matrix completion problems.
That is, given known values M_ij's, the following optimization problem (semi-definite program) is solved to fill in the remaining unknown values of X
min ||X||_* subj to X_ij = M_ij
where ||X||_* denotes the nuclear norm (sum of singular values of X).
For a theoretical treatment of the conditions necessary for exact recovery, see the following paper:
A Simpler Appoarch to Matrix Completion. Benjamin Recht. JMLR 11. http://arxiv.org/pdf/0910.0651v2.pdf
An example of how to use this class is shown below:
Definition at line 53 of file matrix_completion.hpp.
mlpack::matrix_completion::MatrixCompletion::MatrixCompletion | ( | const size_t | m, |
const size_t | n, | ||
const arma::umat & | indices, | ||
const arma::vec & | values, | ||
const size_t | r | ||
) |
Construct a matrix completion problem, specifying the maximum rank of the solution.
m | Number of rows of original matrix. |
n | Number of columns of original matrix. |
indices | Matrix containing the indices of the known entries (must be [2 x p]). |
values | Vector containing the values of the known entries (must be length p). |
r | Maximum rank of solution. |
mlpack::matrix_completion::MatrixCompletion::MatrixCompletion | ( | const size_t | m, |
const size_t | n, | ||
const arma::umat & | indices, | ||
const arma::vec & | values, | ||
const arma::mat & | initialPoint | ||
) |
Construct a matrix completion problem, specifying the initial point of the optimization.
m | Number of rows of original matrix. |
n | Number of columns of original matrix. |
indices | Matrix containing the indices of the known entries (must be [2 x p]). |
values | Vector containing the values of the known entries (must be length p). |
initialPoint | Starting point for the SDP optimization. |
mlpack::matrix_completion::MatrixCompletion::MatrixCompletion | ( | const size_t | m, |
const size_t | n, | ||
const arma::umat & | indices, | ||
const arma::vec & | values | ||
) |
Construct a matrix completion problem.
m | Number of rows of original matrix. |
n | Number of columns of original matrix. |
indices | Matrix containing the indices of the known entries (must be [2 x p]). |
values | Vector containing the values of the known entries (must be length p). |
|
private |
Validate the input matrices.
|
staticprivate |
Select a rank of the matrix given that is of size m x n and has p known elements.
|
private |
Initialize the SDP.
void mlpack::matrix_completion::MatrixCompletion::Recover | ( | arma::mat & | recovered | ) |
Solve the underlying SDP to fill in the remaining values.
recovered | Will contain the completed matrix. |
|
inline |
|
inline |
|
private |
Matrix containing the indices of the known entries (has two rows).
Definition at line 125 of file matrix_completion.hpp.
|
private |
Number of rows in original matrix.
Definition at line 121 of file matrix_completion.hpp.
|
private |
Number of columns in original matrix.
Definition at line 123 of file matrix_completion.hpp.
|
private |
The underlying SDP to be solved.
Definition at line 130 of file matrix_completion.hpp.
Referenced by Sdp().
|
private |
Vector containing the values of the known entries.
Definition at line 127 of file matrix_completion.hpp.