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

Ryan Curtin notifications at github.com
Tue Apr 12 16:19:02 EDT 2016


> +using namespace mlpack;
> +using namespace arma;
> +
> +BOOST_AUTO_TEST_SUITE(SplitDataTest);
> +
> +void compareData(arma::mat const &inputData, arma::mat const &compareData,
> +                 arma::Row<size_t> const &inputLabel)
> +{
> +    for(size_t i = 0; i != compareData.n_cols; ++i){
> +        arma::mat const &lhsCol = inputData.col(inputLabel(i));
> +        arma::mat const &rhsCol = compareData.col(i);
> +        for(size_t j = 0; j != lhsCol.n_rows; ++j){
> +            BOOST_REQUIRE_CLOSE(lhsCol(j), rhsCol(j), 1e-5);
> +        }
> +    }
> +}

Do you mind adding a comment saying what this function does?  It might also be worth noting that this function depends on the labels being equivalent to the original point index (the trick you use in line 36/37).

---
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/860256202d7cba23dd3500a05e36ecd351f1d673#r59445933
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160412/c930c39b/attachment.html>


More information about the mlpack-git mailing list