A weighted random item sampler (selector), where the probability of selecting an item is proportional to its weight, and every item is sampled exactly once (without repetition or replacement). The sampling method utilizes a binary-search optimization, making it suitable for performance-demanding applications where the set of items is large.
nodejs typescript js binary-search weighted-samples weighted-random weighted-sampling logn weighted-random-choice no-repetitions weighted-sampler weighted-select weighted-choice non-replacement no-replacement sample-once non-replacement-weighted-sampling weighted-random-sampling weighted-random-pick weighted-random-select
- Updated
Oct 26, 2024 - TypeScript