MCPcopy Create free account
hub / github.com/Raibows/MLinRust / choice

Method choice

src/utils.rs:161–185  ·  view source on GitHub ↗

randomly choose samples from the given array arr: the pool of candidates num: the number of you want; **note that the num should <= arr.len() if w/o replacement replacement: whether allow repeated samples in the choice true: allowed false: not allowed return: Vector of randomly choosen samples

(&mut self, arr: &Vec<T>, num: usize, replacement: bool)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

newMethod · 0.80

Calls 4

gen_rangeMethod · 0.80
lenMethod · 0.80
into_iterMethod · 0.80
shuffleMethod · 0.45

Tested by

no test coverage detected