mlnext.data.sample_bernoulli#

mlnext.data.sample_bernoulli(mean: ndarray) ndarray[source]#

Samples from a bernoulli distribution with mean.

Parameters:

mean (np.ndarray) – Mean of the bernoulli distribution.

Returns:

Returns the drawn samples.

Return type:

np.ndarray

Example

>>> # Sample from a bernoulli distribution with mean
>>> sample_bernoulli(mean=0.2)
0