Hi, does weighted_pick() return random characters?
with sampling_type=1, return(int(np.searchsorted(t, np.random.rand(1)*s))) looks like giving a random choice out of the array t. And that's what I'm having right now. Is it intentional? Or am I doing something wrong?
Now I got it. t = np.cumsum(weights) makes characters with higher probability to have bigger interval just before itself and that makes the seemingly random choice to be weighted pick. Makes sense.
Hi, does weighted_pick() return random characters?
with
sampling_type=1
,return(int(np.searchsorted(t, np.random.rand(1)*s)))
looks like giving a random choice out of the array t. And that's what I'm having right now. Is it intentional? Or am I doing something wrong?