17 #ifndef JUBATUS_CORE_CLASSIFIER_CLASSIFIER_TEST_UTIL_HPP_
18 #define JUBATUS_CORE_CLASSIFIER_CLASSIFIER_TEST_UTIL_HPP_
28 #include "jubatus/util/math/random.h"
31 jubatus::util::math::random::mtrand& rand,
35 std::vector<double>&
v) {
36 for (
size_t i = 0; i < dim; i++) {
37 float value = rand.next_gaussian(mu, sigma);
43 jubatus::util::math::random::mtrand& rand,
44 const std::vector<float>& mus,
47 std::vector<double>&
v) {
48 for (
size_t i = 0; i < dim; i++) {
49 float value = rand.next_gaussian(mus[i % mus.size()], sigma);
55 jubatus::util::math::random::mtrand& rand) {
56 const float mu_pos = 1.0;
57 const float mu_neg = -1.0;
58 const float sigma = 1.5;
59 const size_t dim = 10;
62 std::pair<std::string, std::vector<double> > p;
63 if (rand() % 2 == 0) {
75 jubatus::util::math::random::mtrand& rand) {
76 const char* labels[] = {
"1",
"2",
"3" };
77 std::vector<float> mus;
82 const float sigma = 1.0;
83 const size_t dim = 10;
85 std::pair<std::string, std::vector<double> > p;
86 size_t l = rand() % 3;
88 std::rotate(mus.begin(), mus.begin() + l, mus.end());
93 #endif // JUBATUS_CORE_CLASSIFIER_CLASSIFIER_TEST_UTIL_HPP_
std::pair< std::string, std::vector< double > > gen_random_data3(jubatus::util::math::random::mtrand &rand)
std::pair< std::string, std::vector< double > > gen_random_data(jubatus::util::math::random::mtrand &rand)
void make_random(jubatus::util::math::random::mtrand &rand, float mu, float sigma, size_t dim, std::vector< double > &v)