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

Function randomly_subsample

dlib/statistics/random_subset_selector.h:283–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281 typename alloc
282 >
283 random_subset_selector<T> randomly_subsample (
284 const std::vector<T,alloc>& samples,
285 unsigned long num
286 )
287 {
288 random_subset_selector<T> subset;
289 subset.set_max_size(num);
290 for (unsigned long i = 0; i < samples.size(); ++i)
291 subset.add(samples[i]);
292 return subset;
293 }
294
295// ----------------------------------------------------------------------------------------
296

Callers 7

do_the_testMethod · 0.85
perform_testMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 5

cast_to_stringFunction · 0.85
set_max_sizeMethod · 0.80
sizeMethod · 0.45
addMethod · 0.45
set_seedMethod · 0.45

Tested by 5

do_the_testMethod · 0.68
perform_testMethod · 0.68