baybe.simulation.scenarios.simulate_scenarios¶
- baybe.simulation.scenarios.simulate_scenarios(scenarios: dict[Any, Campaign], lookup: DataFrame | Callable[[DataFrame], DataFrame] | None = None, /, *, batch_size: int = 1, n_doe_iterations: int | None = None, initial_data: list[DataFrame] | None = None, groupby: list[str] | None = None, n_mc_iterations: int | None = 1, random_seed: int | None = None, impute_mode: Literal['error', 'worst', 'best', 'mean', 'random', 'ignore'] = 'error', noise_percent: float | None = None, parallel_runs: bool | None = None)[source]¶
Simulate multiple Bayesian optimization scenarios.
A wrapper function around
baybe.simulation.core.simulate_experiment()that allows to specify multiple simulation settings at once.- Parameters:
scenarios (
dict[Any,Campaign]) – A dictionary mapping scenario identifiers to DOE specifications.lookup (
Union[DataFrame,Callable[[DataFrame],DataFrame],None]) – Seebaybe.simulation.core.simulate_experiment().batch_size (
int) – Seebaybe.simulation.core.simulate_experiment().n_doe_iterations (
Optional[int]) – Seebaybe.simulation.core.simulate_experiment().initial_data (
Optional[list[DataFrame]]) – A list of initial data sets for which the scenarios should be simulated.groupby (
Optional[list[str]]) – The names of the parameters to be used to partition the search space. A separate simulation will be conducted for each partition, with the search restricted to that partition.n_mc_iterations (
int|None) – The number of Monte Carlo simulations to be used. If set to None, one Monte Carlo simulation per initial data set is conducted, but the random seed is incremented with each initial data set.random_seed (
Optional[int]) – An optional integer specifying the random seed for the first Monte Carlo run. Each subsequent runs will increase this value by 1. If omitted, the current random seed is used.impute_mode (
Literal['error','worst','best','mean','random','ignore']) – Seebaybe.simulation.core.simulate_experiment().noise_percent (
Optional[float]) – Seebaybe.simulation.core.simulate_experiment().parallel_runs (
Optional[bool]) – If set, the value is handed over to theparallelargument ofcombo_runner(), enabling the use of parallel runners. When omitted, its value is determined by theBAYBE_PARALLEL_SIMULATION_RUNSenvironment variable, with fallback toTrue.
- Return type:
- Returns:
A dataframe like returned from
baybe.simulation.core.simulate_experiment()but with additional columns. See theNotefor details.The following additional columns are contained in the dataframe returned by this function:
Scenario: Specifies the scenario identifier of the respective simulation.A column
Random_Seedthat specifies the random seed used for the respective simulation.A column
Initial_Datathat specifies the index of the initial data set used for the respective simulation or contains NaN if no initial data is provided.Optional, if
groupbyis provided: A column for eachgroupbyparameter that specifies the search space partition considered for the respective simulation.