<p>In <a href="https://github.com/mlpack/mlpack/pull/694#discussion_r71082194">src/mlpack/core/data/imputation_methods/median_imputation.hpp</a>:</p>
<pre style='color:#555'>&gt; +  }
&gt; +
&gt; +  /**
&gt; +   * Impute function searches through the input looking for mappedValue and
&gt; +   * replaces it with the median of the given dimension. The result is
&gt; +   * overwritten to the input matrix.
&gt; +   *
&gt; +   * @param input Matrix that contains mappedValue.
&gt; +   * @param mappedValue Value that the user wants to get rid of.
&gt; +   * @param dimension Index of the dimension of the mappedValue.
&gt; +   * @param columnMajor State of whether the input matrix is columnMajor or not.
&gt; +   */
&gt; +  void Impute(arma::Mat&lt;T&gt;&amp; input,
&gt; +              const T&amp; mappedValue,
&gt; +              const size_t dimension,
&gt; +              const bool columnMajor = true)
</pre>
<div class="email-quoted-reply">I might want to load a training set, followed by loading a test set. I</div>
<div class="email-fragment">need to be assured that when I load the test set, the mappings will be the
same as for the training set

I think this is inevitable for DataMapper if you load the training set and
test set separately.
The DataMapper build for training set may/may not work out of the box on
the test set.
If the users load the training set + test set into the same matrix and
split them later on.</div>
<div class="email-quoted-reply">The overload of Impute() that gives a separate output matrix should not</div>
<div class="email-fragment">copy the input matrix to the output matrix,
but instead impute directly into the output matrix, and copy elements as
needed.

Nice idea, did not think of this solution

I think change

output = input;

to

output.set_size(input.n_rows, input.n_cols);

should do the trick, or ask the users to do it before they pass the target
into the Impute function</div>
<div class="email-quoted-reply">Impute() should allow imputation in all dimensions</div>
<div class="email-fragment">I agree withi this one and suggest we make it in another pull request.
There are too many comments and things add to this pull request already.



2016-07-13 22:33 GMT+08:00 Ryan Curtin &lt;notifications@github.com&gt;:</div>
<span class="email-hidden-toggle"><a href="#">…</a></span><div class="email-hidden-reply" style="display:none">
<div class="email-quoted-reply"> In src/mlpack/core/data/imputation_methods/median_imputation.hpp
 &lt;<a href="https://github.com/mlpack/mlpack/pull/694#discussion_r70636674" class="issue-link js-issue-link" data-url="https://github.com/mlpack/mlpack/issues/694" data-id="160089603" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#694 (comment)</a>&gt;:

 &gt; +  }
 &gt; +
 &gt; +  /**
 &gt; +   * Impute function searches through the input looking for mappedValue and
 &gt; +   * replaces it with the median of the given dimension. The result is
 &gt; +   * overwritten to the input matrix.
 &gt; +   *
 &gt; +   * <a href="https://github.com/param" class="user-mention">@param</a> input Matrix that contains mappedValue.
 &gt; +   * <a href="https://github.com/param" class="user-mention">@param</a> mappedValue Value that the user wants to get rid of.
 &gt; +   * <a href="https://github.com/param" class="user-mention">@param</a> dimension Index of the dimension of the mappedValue.
 &gt; +   * <a href="https://github.com/param" class="user-mention">@param</a> columnMajor State of whether the input matrix is columnMajor or not.
 &gt; +   */
 &gt; +  void Impute(arma::Mat&lt;T&gt;&amp; input,
 &gt; +              const T&amp; mappedValue,
 &gt; +              const size_t dimension,
 &gt; +              const bool columnMajor = true)

 When I was looking over this, I thought, maybe this method could be static?
 This probably applies to some other imputation strategies too.

 —
 You are receiving this because you were mentioned.
 Reply to this email directly, view it on GitHub
 &lt;<a href="https://github.com/mlpack/mlpack/pull/694/files/e5d591e511ae449eae1523a80346357b93b968d1#r70636674">https://github.com/mlpack/mlpack/pull/694/files/e5d591e511ae449eae1523a80346357b93b968d1#r70636674</a>&gt;,
 or mute the thread
 &lt;<a href="https://github.com/notifications/unsubscribe/ABt-ugqNq36xMsvvlyZ74oOXd6LaZnFRks5qVPdGgaJpZM4I07W-">https://github.com/notifications/unsubscribe/ABt-ugqNq36xMsvvlyZ74oOXd6LaZnFRks5qVPdGgaJpZM4I07W-</a>&gt;
 .
</div>
<div class="email-fragment"></div>
</div>

<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/e5d591e511ae449eae1523a80346357b93b968d1#r71082194">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFKZxjECwrjHLiFf8KjXC-IJWHOWOks5qWisUgaJpZM4I07W-">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFNdTA0xi2Xjz7z7xtDobvZIFSMBqks5qWisUgaJpZM4I07W-.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/e5d591e511ae449eae1523a80346357b93b968d1#r71082194"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>