lib5c.util.sampling module¶
Module providing utilities related to sampling.
-
lib5c.util.sampling.
uniform_range_coverage_sample
(data, n_points, log_space=False)[source]¶ Performs a deterministic “sampling” step that draws the requested number of evenly-spaced samples from the data.
Even-spacing can be defined in terms of the native space of the data, or in terms of log space.
The marginal distribution of the drawn samples should be approximately uniform - it will not match the empirical distribution of
data
.- Parameters
data (np.ndarray) – The data to sample from.
n_points (int) – The number of points to sample
log_space (bool) – Pass True to space the points evenly in log space, otherwise the points will be spaced evenly in the native space of
data
.