<p>In <a href="https://github.com/mlpack/mlpack/pull/694#discussion_r71882789">src/mlpack/core/data/imputation_methods/mean_imputation.hpp</a>:</p>
<pre style='color:#555'>> + {
> + output(target.first, target.second) = mean;
> + }
> + }
> +
> + /**
> + * Impute function searches through the input looking for mappedValue and
> + * replaces it with the mean of the given dimension. The result is overwritten
> + * to the input matrix.
> + *
> + * @param input Matrix that contains mappedValue.
> + * @param mappedValue Value that the user wants to get rid of.
> + * @param dimension Index of the dimension of the mappedValue.
> + * @param columnMajor State of whether the input matrix is columnMajor or not.
> + */
> + void Impute(arma::Mat<T>& input,
</pre>
<p>I agree, I think the self-assignment check could have some inefficiency, but I am not sure. It would be pretty easy to run a quick check. I would run a check in medium to high dimensions (like 50 or more).</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<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/028c217057410e2e75691c32bf062202ce5dca3f#r71882789">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFMxW3nQlN90UvfDnFdlAsINUZjR6ks5qYMzogaJpZM4I07W-">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFOVXJjgaTJa_G4XOA3hCCGfJkhZfks5qYMzogaJpZM4I07W-.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/028c217057410e2e75691c32bf062202ce5dca3f#r71882789"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>