<p>In <a href="https://github.com/mlpack/mlpack/pull/694#discussion_r68354558">src/mlpack/core/data/imputation_methods/mean_imputation.hpp</a>:</p>
<pre style='color:#555'>&gt; +          targets.push_back(std::make_pair(dimension, i));
&gt; +        }
&gt; +        else
&gt; +        {
&gt; +          elems++;
&gt; +          sum += input(i, dimension);
&gt; +        }
&gt; +      }
&gt; +    }
&gt; +
&gt; +    // calculate mean;
&gt; +    double mean = sum / elems;
&gt; +
&gt; +    // Now replace the calculated mean to the missing variables
&gt; +    // It only needs to loop through targets vector, not the whole matrix.
&gt; +    for (const PairType&amp; target : targets)
</pre>
<p>Neat idea <g-emoji alias="+1" fallback-src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png">👍</g-emoji> </p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/694/files/da4e40981c40e171858f41de4e85e08af2c7e48d..d8618ec909005b0453f0a3803ac1e6cc5e588f1f#r68354558">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFEzDxD4QCs6vYq98LYjWVS66r6K8ks5qO2kagaJpZM4I07W-">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFLNPOLmGzXRs9vtKhrSYru6ERvTCks5qO2kagaJpZM4I07W-.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/694/files/da4e40981c40e171858f41de4e85e08af2c7e48d..d8618ec909005b0453f0a3803ac1e6cc5e588f1f#r68354558"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>