MCPcopy Create free account
hub / github.com/davisking/dlib / make_dataset

Function make_dataset

dlib/test/svm_struct.cpp:485–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483 typedef double scalar_type;
484
485 void make_dataset (
486 std::vector<sample_type>& samples,
487 std::vector<scalar_type>& labels,
488 int num,
489 dlib::rand& rnd
490 )
491 {
492 samples.clear();
493 labels.clear();
494 for (int i = 0; i < 10; ++i)
495 {
496 for (int j = 0; j < num; ++j)
497 {
498 sample_type samp;
499 samp = 0;
500 samp(i) = 10*rnd.get_random_double()+1;
501
502 samples.push_back(samp);
503 labels.push_back(i);
504 }
505 }
506 }
507
508// ----------------------------------------------------------------------------------------
509

Callers 1

perform_testMethod · 0.70

Calls 3

get_random_doubleMethod · 0.80
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected