Dataset.sampling
- Dataset.sampling(sampler: SamplesGenerator = None, n_samples: int = 1000, samples_perfile: int = 1000, callbacks_class: SamplingCallback = None, flag_sample_distrib: bool = False, strategy: str = 'uniform', engine: str = 'sobol', flag_bound_to_range: bool = False, flag_save: bool = True) Tuple[None, DataFrame] [source]
Only a sampling campaign, to obtain design parameters that will be stored.
Optionally, we can provide an ad-hoc function to perform the sampling on the callbacks, and this is run. It still needs to generate as df as output. This callback is run after the sampling, but it can fully override the values provided by it.
- Parameters:
sampler (_type_, optional, default=None) – An object that performs the sampling.
n_samples (int, optional, default=1000) – The number of samples to generate.
samples_perfile (int, optional, default=1000) – The number of samples to include in each file.
callbacks_class (_type_, optional, default=None) – A callback function for running after sampling.
flag_sample_distrib (bool, optional, default=False) – To enforce following the distribution of previous samples, either coming from an import, or those that have been correctly analysed.
strategy (str, optional, default=’uniform’) – The sampling strategy to use. Other:
'kde'
,'quantile'
engine (str, optional, default=’sobol’) – The engine to use for sampling. Other:
'lhc'
,'grid'
,'random'
,'bayesian'
flag_bound_to_range (bool, optional, default=False) – If True, the sampling is performed within the range of the design parameters.
flag_save (bool, optional, default=True) – To save the generated samples or not.
- Returns:
int – Returns 0 if
value_vec
is required to sample around it and generation is not initiated, otherwise returns the number of generated samples.