12#ifndef MLPACK_TESTS_TEST_FUNCTION_TOOLS_HPP
13#define MLPACK_TESTS_TEST_FUNCTION_TOOLS_HPP
35 arma::mat& shuffledData,
36 arma::Row<size_t>& responses,
37 arma::Row<size_t>& testResponses,
38 arma::Row<size_t>& shuffledResponses)
44 data = arma::mat(3, 1000);
45 responses = arma::Row<size_t>(1000);
46 for (
size_t i = 0; i < 500; ++i)
51 for (
size_t i = 500; i < 1000; ++i)
58 arma::uvec indices = arma::shuffle(arma::linspace<arma::uvec>(0,
59 data.n_cols - 1, data.n_cols));
60 shuffledData = arma::mat(3, 1000);
61 shuffledResponses = arma::Row<size_t>(1000);
62 for (
size_t i = 0; i < data.n_cols; ++i)
64 shuffledData.col(i) = data.col(indices[i]);
65 shuffledResponses[i] = responses[indices[i]];
69 testData = arma::mat(3, 1000);
70 testResponses = arma::Row<size_t>(1000);
71 for (
size_t i = 0; i < 500; ++i)
73 testData.col(i) = g1.
Random();
76 for (
size_t i = 500; i < 1000; ++i)
78 testData.col(i) = g2.
Random();
A single multivariate Gaussian distribution.
arma::vec Random() const
Return a randomly generated observation according to the probability distribution defined by this obj...
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
Probability distributions.
Linear algebra utility functions, generally performed on matrices or vectors.