T - The type of sample.public class Bernoulli<T> extends Sampler<T>
emptyIterable, EPSILON| Constructor and Description |
|---|
Bernoulli(double fraction)
Create a Bernoulli sampler with sample fraction and default random number generator.
|
Bernoulli(double fraction,
long seed)
Create a Bernoulli sampler with sample fraction and random number generator seed.
|
Bernoulli(double fraction,
Random random)
Create a Bernoulli sampler with sample fraction and random number generator.
|
| Modifier and Type | Method and Description |
|---|---|
Iterator<T> |
sample(Iterator<T> input)
Sample the input elements, for each input element, take a Bernoulli trail for sampling.
|
public Bernoulli(double fraction)
fraction - Sample fraction, aka the Bernoulli sampler possibility.public Bernoulli(double fraction,
long seed)
fraction - Sample fraction, aka the Bernoulli sampler possibility.seed - Random number generator seed.public Bernoulli(double fraction,
Random random)
fraction - Sample fraction, aka the Bernoulli sampler possibility.random - The random number generator.Copyright © 2021 CDAP Licensed under the Apache License, Version 2.0.