[mlpack-git] [mlpack/mlpack] add train test split (#523)

Marcus Edel notifications at github.com
Mon Apr 18 13:02:10 EDT 2016


> + *TrainTestSplit(input, label, trainData,
> + *               testData, trainLabel, testLabel);
> + *@endcode
> + */
> +template<typename T, typename U>
> +void TrainTestSplit(arma::Mat<T> const &input,
> +                    arma::Row<U> const &inputLabel,
> +                    arma::Mat<T> &trainData,
> +                    arma::Mat<T> &testData,
> +                    arma::Row<U> &trainLabel,
> +                    arma::Row<U> &testLabel,
> +                    double const testRatio)
> +{
> +  size_t const testSize =
> +      static_cast<size_t>(input.n_cols * testRatio);
> +  size_t const trainSize = input.n_cols - testSize;

Sorry to be picky, but maybe we can agree on a style? Do we use const as suffix or prefix, or are we going to accept both styles?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/523/files/c92dd2fc6561b1cf40efb744dcc9233bc3675c91#r60094845
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160418/e9c32f66/attachment.html>


More information about the mlpack-git mailing list