mlpack  master
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
mlpack::matrix_completion::MatrixCompletion Class Reference

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...
 

Detailed Description

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:

size_t m, n; // size of unknown matrix
arma::umat indices; // contains the known indices [2 x n_entries]
arma::vec values; // contains the known values [n_entries]
arma::mat recovered; // will contain the completed matrix
MatrixCompletion mc(m, n, indices, values);
mc.Recover(recovered);
See also
LRSDP

Definition at line 53 of file matrix_completion.hpp.

Constructor & Destructor Documentation

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.

Parameters
mNumber of rows of original matrix.
nNumber of columns of original matrix.
indicesMatrix containing the indices of the known entries (must be [2 x p]).
valuesVector containing the values of the known entries (must be length p).
rMaximum 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.

Parameters
mNumber of rows of original matrix.
nNumber of columns of original matrix.
indicesMatrix containing the indices of the known entries (must be [2 x p]).
valuesVector containing the values of the known entries (must be length p).
initialPointStarting 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.

Parameters
mNumber of rows of original matrix.
nNumber of columns of original matrix.
indicesMatrix containing the indices of the known entries (must be [2 x p]).
valuesVector containing the values of the known entries (must be length p).

Member Function Documentation

void mlpack::matrix_completion::MatrixCompletion::CheckValues ( )
private

Validate the input matrices.

static size_t mlpack::matrix_completion::MatrixCompletion::DefaultRank ( const size_t  m,
const size_t  n,
const size_t  p 
)
staticprivate

Select a rank of the matrix given that is of size m x n and has p known elements.

void mlpack::matrix_completion::MatrixCompletion::InitSDP ( )
private

Initialize the SDP.

void mlpack::matrix_completion::MatrixCompletion::Recover ( arma::mat &  recovered)

Solve the underlying SDP to fill in the remaining values.

Parameters
recoveredWill contain the completed matrix.
const optimization::LRSDP<optimization::SDP<arma::sp_mat> >& mlpack::matrix_completion::MatrixCompletion::Sdp ( ) const
inline

Return the underlying SDP.

Definition at line 115 of file matrix_completion.hpp.

References sdp.

optimization::LRSDP<optimization::SDP<arma::sp_mat> >& mlpack::matrix_completion::MatrixCompletion::Sdp ( )
inline

Modify the underlying SDP.

Definition at line 117 of file matrix_completion.hpp.

References sdp.

Member Data Documentation

arma::umat mlpack::matrix_completion::MatrixCompletion::indices
private

Matrix containing the indices of the known entries (has two rows).

Definition at line 125 of file matrix_completion.hpp.

size_t mlpack::matrix_completion::MatrixCompletion::m
private

Number of rows in original matrix.

Definition at line 121 of file matrix_completion.hpp.

size_t mlpack::matrix_completion::MatrixCompletion::n
private

Number of columns in original matrix.

Definition at line 123 of file matrix_completion.hpp.

optimization::LRSDP<optimization::SDP<arma::sp_mat> > mlpack::matrix_completion::MatrixCompletion::sdp
private

The underlying SDP to be solved.

Definition at line 130 of file matrix_completion.hpp.

Referenced by Sdp().

arma::mat mlpack::matrix_completion::MatrixCompletion::values
private

Vector containing the values of the known entries.

Definition at line 127 of file matrix_completion.hpp.


The documentation for this class was generated from the following file: