Pick a number in {0, 1, ..., numClasses - 1} with the probabilities passed to the sampler given as a constructor argument.
Pick a number in {0, 1, ..., numClasses - 1} with the probabilities passed to the sampler given as a constructor argument. This works by passing k and f to the sampler instance, where k and f are defined as:
val MaxVal = Int.MaxValue.toFloat val h = MurmurHash3 orderedHash data val hAbs = math.abs(h) val k = hAbs % numClasses val f = hAbs / MaxVal
It is assumed that MurmurHash3.orderedHash produces hashes whose bits are uniformly distributed.
The number of different classes in the distribution.