public class BernoulliSampler<T> extends Object implements RandomSampler<T,T>
| Constructor and Description |
|---|
BernoulliSampler(double ratio) |
BernoulliSampler(double lb,
double ub,
boolean complement) |
| Modifier and Type | Method and Description |
|---|---|
BernoulliSampler<T> |
clone() |
BernoulliSampler<T> |
cloneComplement()
Return a sampler that is the complement of the range specified of the current sampler.
|
java.util.Random |
rng() |
scala.collection.Iterator<T> |
sample(scala.collection.Iterator<T> items)
take a random sample
|
void |
setSeed(long seed)
Set random seed.
|
public BernoulliSampler(double lb,
double ub,
boolean complement)
public BernoulliSampler(double ratio)
public java.util.Random rng()
public void setSeed(long seed)
PseudorandomsetSeed in interface Pseudorandompublic scala.collection.Iterator<T> sample(scala.collection.Iterator<T> items)
RandomSamplersample in interface RandomSampler<T,T>public BernoulliSampler<T> cloneComplement()
public BernoulliSampler<T> clone()
clone in interface RandomSampler<T,T>clone in class Object