T
- item typepublic class BernoulliSampler<T> extends Object implements RandomSampler<T,T>
param: fraction the sampling fraction, aka Bernoulli sampling probability
Constructor and Description |
---|
BernoulliSampler(double fraction,
scala.reflect.ClassTag<T> evidence$1) |
Modifier and Type | Method and Description |
---|---|
BernoulliSampler<T> |
clone()
return a copy of the RandomSampler object
|
int |
sample()
Whether to sample the next item or not.
|
void |
setSeed(long seed)
Set random seed.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
sample
public BernoulliSampler(double fraction, scala.reflect.ClassTag<T> evidence$1)
public BernoulliSampler<T> clone()
RandomSampler
clone
in interface RandomSampler<T,T>
clone
in class Object
public int sample()
RandomSampler
sample
in interface RandomSampler<T,T>
public void setSeed(long seed)
Pseudorandom
setSeed
in interface Pseudorandom