-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
as shown above, the d >= randomWeight should be d > randomWeight
It is going to cause a probability error.
if totalWeight == X+Y+Z , weights = [X, X+Y, X+Y+Z]
d >= randomWeight split ranges like [0, X], (X, X+Y], (X+Y, X+Y+Z)
d > randomWeight split ranges like [0, X), [X, X+Y),[X+Y, X+Y+Z)
as we know, the randomWeight is a random number in [0, X+Y+Z)
it means when d >= randomWeight first range's probability will be large than the weight/totalWeight
and last range's probability will be less than the weight/totalWeight
so the correct is d > randomWeight
the fix commit #376
Metadata
Metadata
Assignees
Labels
No labels
