Closed baskaransri closed 4 years ago
I'd quite like if there was an analogue of categorical like:
discrete :: (Foldable f, PrimMonad m) => f (Double, a) -> Prob m a
which would sample from the container, choosing each a with the associated probability.
a
I have an unequal probability sampling implementation in a slightly less well-known library called sampling (see psample, presample), but I agree an implementation would be nice here too. I'll add it.
psample
presample
I'd quite like if there was an analogue of categorical like:
which would sample from the container, choosing each
a
with the associated probability.