Running BOA Optimization Directly in Python#

This notebook demonstrates how to:

Write a basic Wrapper in Python and launch a optimization from Python. If you wanted to launch it from command line, you would do a similar thing of defining the Wrapper, and then put in your configuration file the information about where the wrapper is, and use BOA’s CLI tools. See Running an Experiment from Command Line (Python Wrapper) for more information.

import pathlib

from ax import Trial
from ax.utils.notebook.plotting import init_notebook_plotting
from ax.utils.measurement.synthetic_functions import from_botorch
from botorch.test_functions.synthetic import Cosine8
from ax.service.utils.report_utils import exp_to_df
import numpy as np
import yaml

import boa

init_notebook_plotting()
[INFO 11-30 12:25:37] ax.utils.notebook.plotting: Injecting Plotly library into cell. Do not overwrite or delete cell.

Loading the Config File#

config_path = pathlib.Path().resolve() / "single_config.yaml"

Here we can load the configuration and see what it looks like

We don’t normalize it so we can see it in its original form, but we will need to normalize it later for downstream libraries

config = boa.load_jsonlike(config_path, normalize=False)
print(yaml.dump(config))
optimization_options:
  objective_options:
    objectives:
    - boa_metric: mean
      name: Cosine8
  scheduler:
    total_trials: 100
parameters:
  x0:
    bounds:
    - 0.0
    - 1.0
    type: range
  x1:
    bounds:
    - 0.0
    - 1.0
    type: range
  x2:
    bounds:
    - 0.0
    - 1.0
    type: range
  x3:
    bounds:
    - 0.0
    - 1.0
    type: range
  x4:
    bounds:
    - 0.0
    - 1.0
    type: range
  x5:
    bounds:
    - 0.0
    - 1.0
    type: range
  x6:
    bounds:
    - 0.0
    - 1.0
    type: range
  x7:
    bounds:
    - 0.0
    - 1.0
    type: range

we need the config normalized, which modifies the parameter section into a less user friendly form, but what the downstream libraries need

config = boa.load_jsonlike(config_path)
print(yaml.dump(config))
optimization_options:
  experiment:
    name: boa_runs
  generation_strategy: {}
  objective_options:
    objectives:
    - boa_metric: mean
      name: Cosine8
  scheduler:
    total_trials: 100
parameter_constraints_orig: []
parameters:
- bounds:
  - 0.0
  - 1.0
  name: x0
  type: range
- bounds:
  - 0.0
  - 1.0
  name: x1
  type: range
- bounds:
  - 0.0
  - 1.0
  name: x2
  type: range
- bounds:
  - 0.0
  - 1.0
  name: x3
  type: range
- bounds:
  - 0.0
  - 1.0
  name: x4
  type: range
- bounds:
  - 0.0
  - 1.0
  name: x5
  type: range
- bounds:
  - 0.0
  - 1.0
  name: x6
  type: range
- bounds:
  - 0.0
  - 1.0
  name: x7
  type: range
parameters_orig:
  x0:
    bounds:
    - 0.0
    - 1.0
    type: range
  x1:
    bounds:
    - 0.0
    - 1.0
    type: range
  x2:
    bounds:
    - 0.0
    - 1.0
    type: range
  x3:
    bounds:
    - 0.0
    - 1.0
    type: range
  x4:
    bounds:
    - 0.0
    - 1.0
    type: range
  x5:
    bounds:
    - 0.0
    - 1.0
    type: range
  x6:
    bounds:
    - 0.0
    - 1.0
    type: range
  x7:
    bounds:
    - 0.0
    - 1.0
    type: range

Define Our Wrapper#

This is a silly toy function, in reality, you could instead import your model main() function and use that, and then collect the results. You could also call an external script to start a model run from Bash or elsewhere.

cosine8 = from_botorch(Cosine8())


def run_hartmann6_from_trial(X) -> float:
    result = -cosine8(X)
    return result
class Wrapper(boa.BaseWrapper):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.data = {}

    def run_model(self, trial: Trial) -> None:
        X = np.array([parameter for parameter in trial.arm.parameters.values()])
        self.data[trial.index] = run_hartmann6_from_trial(X)

    def set_trial_status(self, trial: Trial) -> None:
        data_exists = self.data.get(trial.index)
        if data_exists:
            trial.mark_completed()

    def fetch_trial_data_single(self, trial: Trial, metric_properties: dict, metric_name: str, *args, **kwargs) -> dict:
        return dict(a=self.data[trial.index])

Initialize our Setup#

controller = boa.Controller(config_path=config_path, wrapper=Wrapper)

# In general, it is nice to append the time stamp, but we don't here
# so another notebook can always know the exact output folder name

# we also say exist_ok=True so that we can use an existing directory
# for the experiment outcome directory and overwrite it.
controller.setup(working_dir=".", append_timestamp=False, exist_ok=True)
Start time: 20221130T122537
[INFO 11-30 12:25:37] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x0. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.
[INFO 11-30 12:25:37] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x1. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.
[INFO 11-30 12:25:37] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x2. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.
[INFO 11-30 12:25:37] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x3. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.
[INFO 11-30 12:25:37] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x4. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.
[INFO 11-30 12:25:37] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x5. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.
[INFO 11-30 12:25:37] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x6. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.
[INFO 11-30 12:25:37] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x7. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.
[INFO 11-30 12:25:37] ax.service.utils.instantiation: Created search space: SearchSpace(parameters=[RangeParameter(name='x0', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x1', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x2', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x3', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x4', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x5', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x6', parameter_type=FLOAT, range=[0.0, 1.0]), RangeParameter(name='x7', parameter_type=FLOAT, range=[0.0, 1.0])], parameter_constraints=[]).
[INFO 11-30 12:25:37] ax.modelbridge.dispatch_utils: Using Bayesian optimization since there are more ordered parameters than there are categories for the unordered categorical parameters.
[INFO 11-30 12:25:37] ax.modelbridge.dispatch_utils: Using Bayesian Optimization generation strategy: GenerationStrategy(name='Sobol+GPEI', steps=[Sobol for 16 trials, GPEI for subsequent trials]). Iterations after 16 will take longer to generate due to  model-fitting.
[INFO 11-30 12:25:37] Scheduler: `Scheduler` requires experiment to have immutable search space and optimization config. Setting property immutable_search_space_and_opt_config to `True` on experiment.
(Scheduler(experiment=Experiment(boa_runs), generation_strategy=GenerationStrategy(name='Sobol+GPEI', steps=[Sobol for 16 trials, GPEI for subsequent trials]), options=SchedulerOptions(max_pending_trials=10, trial_type=<TrialType.TRIAL: 0>, batch_size=None, total_trials=100, tolerated_trial_failure_rate=0.5, min_failed_trials_for_failure_rate_check=5, log_filepath=None, logging_level=20, ttl_seconds_for_trials=None, init_seconds_between_polls=1, min_seconds_before_poll=1.0, seconds_between_polls_backoff_factor=1.5, timeout_hours=None, run_trials_in_batches=False, debug_log_run_metadata=False, early_stopping_strategy=None, global_stopping_strategy=None, suppress_storage_errors_after_retries=False)),
 <__main__.Wrapper at 0x15254b2e0>)

Run our Experiment#

The Controller will save our scheduler to JSON after it completes the run so we can reload it at a later time for analysis or to resume our experiment

scheduler = controller.run()
[INFO 11-30 12:25:37] Scheduler: Running trials [0]...
[INFO 11-30 12:25:38] Scheduler: Running trials [1]...
[INFO 11-30 12:25:39] Scheduler: Running trials [2]...
[INFO 11-30 12:25:41] Scheduler: Running trials [3]...
[INFO 11-30 12:25:41] Scheduler: Running trials [4]...
[INFO 11-30 12:25:42] Scheduler: Running trials [5]...
[INFO 11-30 12:25:43] Scheduler: Running trials [6]...
[INFO 11-30 12:25:44] Scheduler: Running trials [7]...
[INFO 11-30 12:25:45] Scheduler: Running trials [8]...
[INFO 11-30 12:25:46] Scheduler: Running trials [9]...
[INFO 11-30 12:25:47] Scheduler: Retrieved COMPLETED trials: 0 - 9.
[INFO 11-30 12:25:47] Scheduler: Fetching data for trials: 0 - 9.
[INFO 11-30 12:25:47] Scheduler: Running trials [10]...
[INFO 11-30 12:25:48] Scheduler: Running trials [11]...
[INFO 11-30 12:25:49] Scheduler: Running trials [12]...
[INFO 11-30 12:25:49] Scheduler: Running trials [13]...
[INFO 11-30 12:25:50] Scheduler: Running trials [14]...
[INFO 11-30 12:25:51] Scheduler: Running trials [15]...
[INFO 11-30 12:25:53] Scheduler: Running trials [16]...
[INFO 11-30 12:25:56] Scheduler: Running trials [17]...
[INFO 11-30 12:25:57] Scheduler: Running trials [18]...
[INFO 11-30 12:25:59] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:25:59] Scheduler: Retrieved COMPLETED trials: 10 - 18.
[INFO 11-30 12:25:59] Scheduler: Fetching data for trials: 10 - 18.
[INFO 11-30 12:26:00] Scheduler: Running trials [19]...
[INFO 11-30 12:26:02] Scheduler: Running trials [20]...
[INFO 11-30 12:26:04] Scheduler: Running trials [21]...
[INFO 11-30 12:26:04] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:26:04] Scheduler: Retrieved COMPLETED trials: 19 - 21.
[INFO 11-30 12:26:04] Scheduler: Fetching data for trials: 19 - 21.
[INFO 11-30 12:26:05] Scheduler: Running trials [22]...
[INFO 11-30 12:26:08] Scheduler: Running trials [23]...
[INFO 11-30 12:26:11] Scheduler: Running trials [24]...
[INFO 11-30 12:26:12] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:26:12] Scheduler: Retrieved COMPLETED trials: 22 - 24.
[INFO 11-30 12:26:12] Scheduler: Fetching data for trials: 22 - 24.
[INFO 11-30 12:26:13] Scheduler: Running trials [25]...
[INFO 11-30 12:26:15] Scheduler: Running trials [26]...
[INFO 11-30 12:26:18] Scheduler: Running trials [27]...
[INFO 11-30 12:26:19] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:26:19] Scheduler: Retrieved COMPLETED trials: 25 - 27.
[INFO 11-30 12:26:19] Scheduler: Fetching data for trials: 25 - 27.
[INFO 11-30 12:26:20] Scheduler: Running trials [28]...
[INFO 11-30 12:26:21] Scheduler: Running trials [29]...
[INFO 11-30 12:26:23] Scheduler: Running trials [30]...
[INFO 11-30 12:26:24] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:26:24] Scheduler: Retrieved COMPLETED trials: 28 - 30.
[INFO 11-30 12:26:24] Scheduler: Fetching data for trials: 28 - 30.
[INFO 11-30 12:26:25] Scheduler: Running trials [31]...
[INFO 11-30 12:26:27] Scheduler: Running trials [32]...
[INFO 11-30 12:26:30] Scheduler: Running trials [33]...
[INFO 11-30 12:26:31] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:26:31] Scheduler: Retrieved COMPLETED trials: 31 - 33.
[INFO 11-30 12:26:31] Scheduler: Fetching data for trials: 31 - 33.
[INFO 11-30 12:26:32] Scheduler: Running trials [34]...
[INFO 11-30 12:26:33] Scheduler: Running trials [35]...
[INFO 11-30 12:26:36] Scheduler: Running trials [36]...
[INFO 11-30 12:26:37] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:26:37] Scheduler: Retrieved COMPLETED trials: 34 - 36.
[INFO 11-30 12:26:37] Scheduler: Fetching data for trials: 34 - 36.
[INFO 11-30 12:26:39] Scheduler: Running trials [37]...
[INFO 11-30 12:26:40] Scheduler: Running trials [38]...
[INFO 11-30 12:26:42] Scheduler: Running trials [39]...
[INFO 11-30 12:26:43] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:26:43] Scheduler: Retrieved COMPLETED trials: 37 - 39.
[INFO 11-30 12:26:43] Scheduler: Fetching data for trials: 37 - 39.
[INFO 11-30 12:26:45] Scheduler: Running trials [40]...
[INFO 11-30 12:26:46] Scheduler: Running trials [41]...
[INFO 11-30 12:26:48] Scheduler: Running trials [42]...
[INFO 11-30 12:26:49] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:26:49] Scheduler: Retrieved COMPLETED trials: 40 - 42.
[INFO 11-30 12:26:49] Scheduler: Fetching data for trials: 40 - 42.
[INFO 11-30 12:26:51] Scheduler: Running trials [43]...
[INFO 11-30 12:26:52] Scheduler: Running trials [44]...
[INFO 11-30 12:26:54] Scheduler: Running trials [45]...
[INFO 11-30 12:26:55] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:26:55] Scheduler: Retrieved COMPLETED trials: 43 - 45.
[INFO 11-30 12:26:55] Scheduler: Fetching data for trials: 43 - 45.
[INFO 11-30 12:26:56] Scheduler: Running trials [46]...
[INFO 11-30 12:26:57] Scheduler: Running trials [47]...
[INFO 11-30 12:26:58] Scheduler: Running trials [48]...
[INFO 11-30 12:26:59] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:26:59] Scheduler: Retrieved COMPLETED trials: 46 - 48.
[INFO 11-30 12:26:59] Scheduler: Fetching data for trials: 46 - 48.
[INFO 11-30 12:26:59] Scheduler: Running trials [49]...
[INFO 11-30 12:27:01] Scheduler: Running trials [50]...
[INFO 11-30 12:27:02] Scheduler: Running trials [51]...
[INFO 11-30 12:27:03] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:27:03] Scheduler: Retrieved COMPLETED trials: 49 - 51.
[INFO 11-30 12:27:03] Scheduler: Fetching data for trials: 49 - 51.
[INFO 11-30 12:27:03] Scheduler: Running trials [52]...
[INFO 11-30 12:27:05] Scheduler: Running trials [53]...
[INFO 11-30 12:27:09] Scheduler: Running trials [54]...
[INFO 11-30 12:27:10] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:27:10] Scheduler: Retrieved COMPLETED trials: 52 - 54.
[INFO 11-30 12:27:10] Scheduler: Fetching data for trials: 52 - 54.
[INFO 11-30 12:27:10] Scheduler: Running trials [55]...
[INFO 11-30 12:27:11] Scheduler: Running trials [56]...
[INFO 11-30 12:27:15] Scheduler: Running trials [57]...
[INFO 11-30 12:27:16] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:27:16] Scheduler: Retrieved COMPLETED trials: 55 - 57.
[INFO 11-30 12:27:16] Scheduler: Fetching data for trials: 55 - 57.
[INFO 11-30 12:27:16] Scheduler: Running trials [58]...
[INFO 11-30 12:27:18] Scheduler: Running trials [59]...
[INFO 11-30 12:27:20] Scheduler: Running trials [60]...
[INFO 11-30 12:27:21] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:27:21] Scheduler: Retrieved COMPLETED trials: 58 - 60.
[INFO 11-30 12:27:21] Scheduler: Fetching data for trials: 58 - 60.
[INFO 11-30 12:27:21] Scheduler: Running trials [61]...
[INFO 11-30 12:27:22] Scheduler: Running trials [62]...
[INFO 11-30 12:27:24] Scheduler: Running trials [63]...
[INFO 11-30 12:27:25] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:27:25] Scheduler: Retrieved COMPLETED trials: 61 - 63.
[INFO 11-30 12:27:25] Scheduler: Fetching data for trials: 61 - 63.
[INFO 11-30 12:27:26] Scheduler: Running trials [64]...
[INFO 11-30 12:27:27] Scheduler: Running trials [65]...
[INFO 11-30 12:27:29] Scheduler: Running trials [66]...
[INFO 11-30 12:27:30] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:27:30] Scheduler: Retrieved COMPLETED trials: 64 - 66.
[INFO 11-30 12:27:30] Scheduler: Fetching data for trials: 64 - 66.
[INFO 11-30 12:27:30] Scheduler: Running trials [67]...
[INFO 11-30 12:27:32] Scheduler: Running trials [68]...
[INFO 11-30 12:27:35] Scheduler: Running trials [69]...
[INFO 11-30 12:27:36] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:27:36] Scheduler: Retrieved COMPLETED trials: 67 - 69.
[INFO 11-30 12:27:36] Scheduler: Fetching data for trials: 67 - 69.
[INFO 11-30 12:27:36] Scheduler: Running trials [70]...
[INFO 11-30 12:27:37] Scheduler: Running trials [71]...
[INFO 11-30 12:27:39] Scheduler: Running trials [72]...
[INFO 11-30 12:27:39] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:27:39] Scheduler: Retrieved COMPLETED trials: 70 - 72.
[INFO 11-30 12:27:39] Scheduler: Fetching data for trials: 70 - 72.
[INFO 11-30 12:27:39] Scheduler: Running trials [73]...
[INFO 11-30 12:27:40] Scheduler: Running trials [74]...
[INFO 11-30 12:27:43] Scheduler: Running trials [75]...
[INFO 11-30 12:27:44] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:27:44] Scheduler: Retrieved COMPLETED trials: 73 - 75.
[INFO 11-30 12:27:44] Scheduler: Fetching data for trials: 73 - 75.
[INFO 11-30 12:27:45] Scheduler: Running trials [76]...
[INFO 11-30 12:27:46] Scheduler: Running trials [77]...
[INFO 11-30 12:27:48] Scheduler: Running trials [78]...
[INFO 11-30 12:27:49] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:27:49] Scheduler: Retrieved COMPLETED trials: 76 - 78.
[INFO 11-30 12:27:49] Scheduler: Fetching data for trials: 76 - 78.
[INFO 11-30 12:27:49] Scheduler: Running trials [79]...
[INFO 11-30 12:27:50] Scheduler: Running trials [80]...
[INFO 11-30 12:27:52] Scheduler: Running trials [81]...
[INFO 11-30 12:27:53] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:27:53] Scheduler: Retrieved COMPLETED trials: 79 - 81.
[INFO 11-30 12:27:53] Scheduler: Fetching data for trials: 79 - 81.
[INFO 11-30 12:27:53] Scheduler: Running trials [82]...
[INFO 11-30 12:27:57] Scheduler: Running trials [83]...
[INFO 11-30 12:28:01] Scheduler: Running trials [84]...
[INFO 11-30 12:28:02] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:28:02] Scheduler: Retrieved COMPLETED trials: 82 - 84.
[INFO 11-30 12:28:02] Scheduler: Fetching data for trials: 82 - 84.
[INFO 11-30 12:28:03] Scheduler: Running trials [85]...
[INFO 11-30 12:28:05] Scheduler: Running trials [86]...
[INFO 11-30 12:28:06] Scheduler: Running trials [87]...
[INFO 11-30 12:28:07] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:28:07] Scheduler: Retrieved COMPLETED trials: 85 - 87.
[INFO 11-30 12:28:07] Scheduler: Fetching data for trials: 85 - 87.
[INFO 11-30 12:28:08] Scheduler: Running trials [88]...
[INFO 11-30 12:28:09] Scheduler: Running trials [89]...
[INFO 11-30 12:28:10] Scheduler: Running trials [90]...
[INFO 11-30 12:28:11] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:28:11] Scheduler: Retrieved COMPLETED trials: 88 - 90.
[INFO 11-30 12:28:11] Scheduler: Fetching data for trials: 88 - 90.
[INFO 11-30 12:28:12] Scheduler: Running trials [91]...
[INFO 11-30 12:28:14] Scheduler: Running trials [92]...
[INFO 11-30 12:28:15] Scheduler: Running trials [93]...
[INFO 11-30 12:28:16] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:28:16] Scheduler: Retrieved COMPLETED trials: 91 - 93.
[INFO 11-30 12:28:16] Scheduler: Fetching data for trials: 91 - 93.
[INFO 11-30 12:28:16] Scheduler: Running trials [94]...
[INFO 11-30 12:28:17] Scheduler: Running trials [95]...
[INFO 11-30 12:28:19] Scheduler: Running trials [96]...
[INFO 11-30 12:28:20] Scheduler: Generated all trials that can be generated currently. Max parallelism currently reached.
[INFO 11-30 12:28:20] Scheduler: Retrieved COMPLETED trials: 94 - 96.
[INFO 11-30 12:28:20] Scheduler: Fetching data for trials: 94 - 96.
[INFO 11-30 12:28:20] Scheduler: Running trials [97]...
[INFO 11-30 12:28:21] Scheduler: Running trials [98]...
[INFO 11-30 12:28:22] Scheduler: Running trials [99]...
[INFO 11-30 12:28:23] Scheduler: Retrieved COMPLETED trials: 97 - 99.
[INFO 11-30 12:28:23] Scheduler: Fetching data for trials: 97 - 99.

Trials completed! Total run time: 165
Saved JSON-serialized state of optimization to `boa_runs/scheduler.json`.
## Get the Best Trial and Output All Trials
best_trial, best_params, obj = scheduler.get_best_trial()
best_trial
99
experiment = scheduler.experiment
exp_to_df(experiment)
Cosine8 trial_index arm_name x0 x1 x2 x3 x4 x5 x6 x7 trial_status generation_method
0 2.167124 0 0_0 0.774544 0.468805 0.068063 0.362316 0.879579 0.273648 0.832961 0.104289 COMPLETED Sobol
1 1.332692 1 1_0 0.490980 0.122534 0.286072 0.135533 0.407212 0.516411 0.552975 0.209887 COMPLETED Sobol
2 2.239779 2 2_0 0.370515 0.437868 0.613205 0.630494 0.135183 0.472351 0.552578 0.686980 COMPLETED Sobol
3 3.417184 3 3_0 0.136836 0.695278 0.936232 0.844562 0.099137 0.971449 0.467957 0.413035 COMPLETED Sobol
4 4.009739 4 4_0 0.747055 0.203236 0.984640 0.257893 0.542277 0.742640 0.682041 0.910413 COMPLETED Sobol
... ... ... ... ... ... ... ... ... ... ... ... ... ...
95 3.157963 95 95_0 0.428170 0.875173 0.948110 0.439605 0.663419 0.438504 0.603967 0.475487 COMPLETED GPEI
96 1.803210 96 96_0 0.516141 0.635045 0.359797 0.222931 0.587980 0.171713 0.471170 0.425680 COMPLETED GPEI
97 2.426793 97 97_0 0.385700 0.414825 0.168669 0.768933 0.446303 0.664891 0.797453 0.790683 COMPLETED GPEI
98 3.770818 98 98_0 0.568660 0.763975 0.816566 0.932060 0.571092 0.517328 0.833606 0.391031 COMPLETED GPEI
99 3.341448 99 99_0 0.779255 0.245177 0.975580 0.867021 0.315499 0.468669 0.496713 0.597464 COMPLETED GPEI

100 rows × 13 columns