Dataset.get_samples
- Dataset.get_samples(sampler: SamplesGenerator = None, analyzer: AnalysisCallback = None, n_samples: int = 1, format_in: str = 'df', format_out: str = 'df', callbacks_class: SamplingCallback = None, flag_sample_distrib: bool = False, strategy: str = 'uniform', engine: str = 'sobol', flag_bound_to_range: bool = False)[source]
Method to obtain some samples and return them in the desired format, but without saving them into files. Besides, if an AnalysisCallback is provided, the samples are analyzed and a combined output is returned, with design parameters and performance attributes.
- Parameters:
sampler (SamplesGenerator, optional, default=None) – An object that performs the sampling. If None, the sampler is created following the strategy and engine.
analyzer (AnalysisCallback, optional, default=None) – The callback function created with the analysis function. It feeds the design parameters to the analysis function, obtains the performance attributes, and ensures they are returned in the correct format. If None, only design parameters are returned.
n_samples (int, optional, default=1) – The number of samples to generate.
format_in (str, optional, default=”df”) – The format required by the analyzer function for the input data to use. Other options are:
'dict'
,'dict_list'
,'array'
,'torch'
,'list'
,'df_per_obj'
,'df'
format_out (str, optional, default=”df”) – The format in which we want the output to be returned. Other options are:
'dict'
,'dict_list'
,'array'
,'torch'
,'list'
,'df_per_obj'
,'df'
callbacks_class (SamplingCallback, 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.