biomedical_data_generator.utils.sampling
Utility functions for sampling from distributions.
Functions
|
Draw a block of independent samples from a NumPy RNG distribution. |
- biomedical_data_generator.utils.sampling.sample_distribution(distribution, params, rng, size)[source]
Draw a block of independent samples from a NumPy RNG distribution.
The distribution string is expected to match the corresponding numpy.random.Generator method name, except for “exp_normal”, which is implemented as exp(rng.normal(…)).
All parameter names and values are validated in DatasetConfig / ClassConfig via validate_distribution_params, so this function only dispatches to the correct RNG method.
Noneparams resolve to an empty mapping, falling back to the RNG method’s own defaults.