Skip to main content

random_with_replacement

Function random_with_replacement 

Source
pub fn random_with_replacement(
    dataset_size: usize,
    num_samples: usize,
    seed: Option<u64>,
) -> RandomSampler
Expand description

Create a random sampler with replacement

Convenience function for creating a random sampler that samples with replacement.

ยงArguments

  • dataset_size - Number of samples in the dataset
  • num_samples - Number of samples to yield
  • seed - Optional random seed for reproducible sampling