<p>In <a href="https://github.com/mlpack/mlpack/pull/694#discussion_r68375949">src/mlpack/core/data/imputation_methods/mean_imputation.hpp</a>:</p>
<pre style='color:#555'>&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)
&gt; +    {
&gt; +      if (input(target.first, target.second) == mappedValue)
</pre>
<p>I think we can omit the check at here</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#r68375949">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFPW48sN1WlVhVcvMy6Ds0709meBGks5qO6Y1gaJpZM4I07W-">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFFykpd25fKTINBSHnbHVMHJUMapjks5qO6Y1gaJpZM4I07W-.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#r68375949"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>