17 #ifndef JUBATUS_CORE_REGRESSION_REGRESSION_TEST_UTIL_HPP_
18 #define JUBATUS_CORE_REGRESSION_REGRESSION_TEST_UTIL_HPP_
27 #include "jubatus/util/math/random.h"
33 std::vector<double>&
v) {
34 jubatus::util::math::random::mtrand rand(0);
35 for (
size_t i = 0; i < dim; i++) {
36 float value = rand.next_gaussian(mu, sigma);
42 jubatus::util::math::random::mtrand rand(0);
43 for (
size_t i = 0; i < dim; i++) {
44 double value = rand.next_double();
53 std::pair<float, std::vector<double> > p;
55 std::vector<double> coef;
58 for (
size_t i = 0; i < dim; i++) {
59 p.first += p.second[i] * coef[i];
64 #endif // JUBATUS_CORE_REGRESSION_REGRESSION_TEST_UTIL_HPP_
std::pair< float, std::vector< double > > gen_random_data(float mu, float sigma, size_t dim)
void make_random(size_t dim, std::vector< double > &v)
void make_gaussian_random(float mu, float sigma, size_t dim, std::vector< double > &v)