<p>In <a href="https://github.com/mlpack/mlpack/pull/374#discussion-diff-22771496">src/mlpack/methods/matrix_completion/matrix_completion.hpp</a>:</p>
<pre style='color:#555'>&gt; +   * @param m Number of rows of original matrix.
&gt; +   * @param n Number of columns of original matrix.
&gt; +   * @param indices Matrix containing the indices of the known entries (must be
&gt; +   *    [2 x p]).
&gt; +   * @param values Vector containing the values of the known entries (must be
&gt; +   *    length p).
&gt; +   */
&gt; +  MatrixCompletion(const size_t m,
&gt; +                   const size_t n,
&gt; +                   const arma::umat&amp; indices,
&gt; +                   const arma::vec&amp; values);
&gt; +
&gt; +  /**
&gt; +   * Solve the underlying SDP to fill in the remaining values.
&gt; +   */
&gt; +  void Recover();
</pre>
<p>I looked at the CF code a bit. I think the best way to integrate the two is to write a separate shim (living inside the cf or amf folder) which glues the interfaces. The main reason for this is because I don't quite like the special casing of zero which arises when using sparse matrices to represent the known matrix, and since it's baked into the amf/cf code, I'd prefer to bake the semantics into the shim layer rather than this class.</p>

<p>The special casing of zero makes sense for recommendations (where it doesn't make sense to rate something zero), but not so much for general matrix completion. For instance, if I want to complete say, an image, then its reasonable I have some known zero (e.g. black) pixel values. </p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/374/files#r22771496">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFLGx9JZAqzUoV2AQhz4YzmnHNk68ks5ngvfpgaJpZM4DOLPX.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/374/files#r22771496"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>