GitHub topics: weighted-sampler
ori88c/weighted-random-item-sampler
A weighted random item sampler (selector), where the probability of selecting an item is proportional to its weight. The sampling method utilizes a binary search optimization, making it suitable for performance-demanding applications where the set of items is large and the sampling frequency is high.
Language: TypeScript - Size: 93.8 KB - Last synced at: 16 days ago - Pushed at: 7 months ago - Stars: 0 - Forks: 0

ori88c/non-replacement-weighted-random-item-sampler
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.
Language: TypeScript - Size: 72.3 KB - Last synced at: 7 days ago - Pushed at: 7 months ago - Stars: 0 - Forks: 0
