<blockquote>
<p>I would go with references, to be more consistent with the other mlpack code that has functions like this.</p>
</blockquote>

<p>I suggest we add another overload to accept the reference and keep the old api, because <br>
In this case, there would be 6 parameters need to pass into the api</p>

<p>TrainTestSplit(const MatType&amp; input, MatType&amp; train, MatType&amp; test, Row &amp;trainLabel,<br>
Row &amp;testLabel, double testRatio, unsigned int seed = 0);</p>

<blockquote>
<p>You can create a random vector of indexes using armadillo instead of using an std::vector.</p>
</blockquote>

<p>Thanks, arma version looks neat and shorter</p>

<blockquote>
<p>works with data matrices with more than one dimension. Imagine a dataset of images with more than one channel per image.</p>
</blockquote>

<p>I beg of your pardon, could you show me more details?Do you mean</p>

<p>a : Treat arma::Mat as a whole image(1~n channels), arma::Cube as a container of those images</p>

<p>I think this is not a problem, the overload of arma::Cube already solve this problem. We could store pixels of multi channels image into arma::Mat, store arma::Mat(from one channel to n channels) into arma::Cube, then split them.</p>

<p>b : You want to split arma::Mat of n into different channels?</p>

<p>If it is case b, different libraries may have different way to store their pixels, I think it is better to let the users preprocess their data first</p>

<p>or another cases?</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/523#issuecomment-188849544">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFJxJeAdiyE-LiULpru3g8SC43KvDks5pnxo3gaJpZM4HhWF3.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/523#issuecomment-188849544"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>