[1]:
# docs-warning-suppress
import logging
import warnings
warnings.filterwarnings('ignore', category=DeprecationWarning, module=r'torch\.jit\._script')
warnings.filterwarnings('ignore', category=DeprecationWarning, module=r'matplotlib\._fontconfig_pattern')
warnings.filterwarnings('ignore', message=r".*oneOf.*deprecated.*one_of.*", module=r'matplotlib\._fontconfig_pattern')
warnings.filterwarnings('ignore', message=r".*parseString.*deprecated.*parse_string.*", module=r'matplotlib\._fontconfig_pattern')
warnings.filterwarnings('ignore', message=r".*resetCache.*deprecated.*reset_cache.*", module=r'matplotlib\._fontconfig_pattern')
try:
    from ax.exceptions.core import AxParameterWarning
    warnings.filterwarnings('ignore', category=AxParameterWarning)
except Exception:
    pass
try:
    from pyparsing import PyparsingDeprecationWarning
    warnings.filterwarnings('ignore', category=PyparsingDeprecationWarning)
except Exception:
    pass
logging.getLogger('ax').setLevel(logging.WARNING)
logging.getLogger('ax.service.utils.instantiation').setLevel(logging.ERROR)
logging.getLogger('ax.generation_strategy.dispatch_utils').setLevel(logging.WARNING)
try:
    import plotly.graph_objects as go
    _orig_show = go.Figure.show
    def _responsive_show(fig, *args, **kwargs):
        fig.update_layout(autosize=True)
        config = kwargs.get('config') or {}
        config.setdefault('responsive', True)
        kwargs['config'] = config
        return _orig_show(fig, *args, **kwargs)
    go.Figure.show = _responsive_show
except Exception:
    pass

Bayesian Optimization#

Installation#

Create a virtual environment named .venv, activate it, then install the package:

python -m venv .venv
source .venv/bin/activate # Linux / macOS
python -m pip install --upgrade pip
python -m pip install optimeo

After that, launch the app with:

optimeo

If you are using the repo directly, you can also install from GitHub:

python -m pip install "git+https://github.com/colinbousige/OPTIMEO.git"

This notebook shows how to prepare and optimize experiments once the package is installed.

[2]:
# For Google Colab
!pip install git+https://github.com/colinbousige/OPTIMEO.git# For local development, prefer:
# uv venv .venv --python 3.10 && source .venv/bin/activate && uv sync


[notice] A new release of pip is available: 26.1.1 -> 26.1.2
[notice] To update, run: pip install --upgrade pip
ERROR: Invalid requirement: 'development,': Expected semicolon (after name with no version specifier) or end
    development,
               ^

Single outcome#

First, we generate some data#

Let’s create an experimental_data(temp, conc) function that simulates the yield of a chemical reaction based on temperature and concentration. The yield is a function of these two variables, and we will use Bayesian Optimization to find the position of the maximum in the minimum number of experiments.

In the following block, we just plot this function to see what it looks like(but in real life, you have no idea what the function looks like). We also create an experimental data set where we have already done some experiments (they are the red crosses in the plot).

[3]:
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import plotly.io as pio
# pio.renderers.default = "notebook"
pio.renderers.default = "notebook_connected"

def experimental_data(temp, conc):
    """
    This function simulates experimental data based on temperature and concentration.
    The function is a Gaussian-like function that peaks at certain temperature and concentration values.
    The function is not based on any real experimental data and is purely for demonstration purposes.
    """
    out = np.exp(-((temp - 50) ** 2)/1000)*np.exp(-((conc - .50) ** 2)/.05)-.9*np.exp(-((temp - 45) ** 2)/100)*np.exp(-((conc - .450) ** 2)/.05)
    return out

def generate_data(N=100):
    temp = np.linspace(0, 100, N)
    conc = np.linspace(0, 1, N)
    data = np.meshgrid(temp, conc)
    temp, conc = data[0].flatten(), data[1].flatten()
    exp_data = experimental_data(temp, conc)
    df = pd.DataFrame({'Temperature': temp, 'Concentration': conc, 'Yield': exp_data})
    return df

df = generate_data(500)

# Prepare data for 3D surface plot
unique_temps = np.unique(df['Temperature'])
unique_concs = np.unique(df['Concentration'])
Z = df.pivot(index='Concentration', columns='Temperature', values='Yield').values
# find the maximum yield and its position
max_yield = np.max(Z)
max_pos = np.unravel_index(np.argmax(Z), Z.shape)
max_temp = unique_temps[max_pos[1]]
max_conc = unique_concs[max_pos[0]]

# Create the contour plot
fig = go.Figure(data=[go.Contour(
    z=Z,
    x=unique_temps,
    y=unique_concs,
    colorscale='Viridis',
    contours=dict(coloring='heatmap', size=0.1),
    hovertemplate='Temperature: %{x}<br>Concentration: %{y}<br>Yield: %{z}<extra></extra>'
)])

# Update layout with legend at the top, below the title
fig.update_layout(
    xaxis_title='Temperature',
    yaxis_title='Concentration',
    legend=dict(
        x=0.5,  # Center the legend horizontally
        y=1.05,  # Place the legend just below the title
        orientation='h',  # Horizontal orientation
        xanchor='center',
        yanchor='bottom'
    )
)

# Add a marker for the maximum yield
fig.add_trace(go.Scatter(
    x=[max_temp],
    y=[max_conc],
    mode='markers',
    marker=dict(size=10, color='red', symbol='x'),
    name='Max Yield that we want to determine through experiments',
    customdata=[[max_yield]],  # Add max_yield as custom data
    hovertemplate='Max Yield:<br>Temperature: %{x}<br>Concentration: %{y}<br>Yield: %{customdata[0]}<extra></extra>'
))

# Create some sample data
df_sample = generate_data(2)

# Add the experimental data on the plot
fig.add_trace(go.Scatter(
    x=df_sample['Temperature'],
    y=df_sample['Concentration'],
    mode='markers',
    marker=dict(size=10, color='white', symbol='circle',
                line=dict(width=2, color='black')),
    name='Experimental measurements we have so far',
))

fig.show(config={'responsive': True})

# Save the experimental data to a CSV file
df_sample.to_csv('experimental_data.csv', index=False)
pio.renderers['notebook_connected'].config = {'responsive': True}

Bayesian Optimization#

Now, we will use the OPTIMEO package to perform Bayesian Optimization. First, we load the data in the right format.

[4]:
from optimeo.bo import BOExperiment, read_experimental_data

# there is only one outcome here, in the last column (-1)
features, outcomes = read_experimental_data('experimental_data.csv', out_pos=[-1])
print(f"Features:\n{features}")
print(f"Outcomes:\n{outcomes}")
Features:
{'Temperature': {'type': 'float', 'data': [0.0, 100.0, 0.0, 100.0], 'range': [np.float64(0.0), np.float64(100.0)]}, 'Concentration': {'type': 'float', 'data': [0.0, 0.0, 1.0, 1.0], 'range': [np.float64(0.0), np.float64(1.0)]}}
Outcomes:
{'Yield': {'type': 'float', 'data': [0.0005530843449776, 0.0005530843701466, 0.0005530843667414, 0.0005530843701476]}}
/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:64: PyparsingDeprecationWarning:

'oneOf' deprecated - use 'one_of'

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:85: PyparsingDeprecationWarning:

'parseString' deprecated - use 'parse_string'

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:89: PyparsingDeprecationWarning:

'resetCache' deprecated - use 'reset_cache'

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:85: PyparsingDeprecationWarning:

'parseString' deprecated - use 'parse_string'

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:89: PyparsingDeprecationWarning:

'resetCache' deprecated - use 'reset_cache'

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:85: PyparsingDeprecationWarning:

'parseString' deprecated - use 'parse_string'

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:89: PyparsingDeprecationWarning:

'resetCache' deprecated - use 'reset_cache'

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:85: PyparsingDeprecationWarning:

'parseString' deprecated - use 'parse_string'

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:89: PyparsingDeprecationWarning:

'resetCache' deprecated - use 'reset_cache'

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:85: PyparsingDeprecationWarning:

'parseString' deprecated - use 'parse_string'

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:89: PyparsingDeprecationWarning:

'resetCache' deprecated - use 'reset_cache'

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:85: PyparsingDeprecationWarning:

'parseString' deprecated - use 'parse_string'

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/matplotlib/_fontconfig_pattern.py:89: PyparsingDeprecationWarning:

'resetCache' deprecated - use 'reset_cache'

The ranges and types of the features are automatically determined from the data (see the data printed above). In case you want to change the ranges or types, you can do so editing the corresponding fields in the features dict or by providing a ranges dict. The ranges should be in the format {'feature_name': [minvalue,maxvalue]}. If the ranges are not provided either in features or in ranges, they will be determined from the data.

[5]:
ranges = {'Temperature': [-10,100]}

Now, let’s create the BOExperiment object. This object contains the data, the features, and the model. The model is a Gaussian Process with a Matern kernel.

[6]:
bo = BOExperiment(
    features=features,
    outcomes=outcomes,
    # ranges=ranges,
    N = 1, # number of new points to generate
    maximize=True, # we want to maximize the response
    outcome_constraints=None,
    fixed_features=None, # fixed features are not used here
    # but they can be added as fixed_features = {Temperature: 50, Concentration: 0.5}
    feature_constraints=None, # feature constraints are not used here
    # but they can be added as
    # feature_constraints = ['Concentration + Temperature <= 200']
    optim = 'sobol', # sobol is used to randomly generate the new points
    # to actually optimize, use optim = 'bo'
)
[WARNING 06-02 08:32:07] ax.adapter.transforms.standardize_y: Outcome Yield is constant, within tolerance.

========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/botorch/models/utils/assorted.py:274: InputDataWarning:

Data (outcome observations) is not standardized (std = tensor([1.2124e-11], dtype=torch.float64), mean = tensor([-8.1315e-20], dtype=torch.float64)).Please consider scaling the input to zero mean and unit variance.

[7]:
bo
[7]:

BOExperiment(
    N=1,
    maximize={'Yield': True},
    outcome_constraints=None,
    feature_constraints=None,
    optim=sobol
)

Input data:

   Temperature  Concentration     Yield
0          0.0            0.0  0.000553
1        100.0            0.0  0.000553
2          0.0            1.0  0.000553
3        100.0            1.0  0.000553

[8]:
new_points = bo.suggest_next_trials()
print(f"New points to sample:\n{new_points}")
fig = bo.plot_model()
fig.show(config={'responsive': True})
New points to sample:
   Temperature  Concentration  Predicted_Yield
0    99.751335       0.104366         0.000553
Arm 0_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 0<br>Concentration: 0
Arm 1_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 100<br>Concentration: 0
Arm 2_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 0<br>Concentration: 1
Arm 3_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 100<br>Concentration: 1
Arm 0_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 0<br>Concentration: 0
Arm 1_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 100<br>Concentration: 0
Arm 2_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 0<br>Concentration: 1
Arm 3_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 100<br>Concentration: 1

Now let’s do the optimization. We will first perform 6 random point generations, then use Bayesian Optimization to find the maximum of the function.By default, OPTIMEO uses a balanced acquisition setup. You can also tune exploration vs exploitation with UCB-style acquisition settings via acq_func:- For single candidate generation (N = 1): use UpperConfidenceBound- For batch generation (N > 1): use qUpperConfidenceBound``beta controls exploration: higher = more exploration, lower = more exploitation.

[9]:
for i in range(30): #let's do 30 iterations
    if i==6:
        bo.optim = 'bo' # change to BO optimization after 6 iterations
    # simulate the new points
    new = bo.suggest_next_trials(with_predicted=False)
    newT = new['Temperature'].values
    newC = new['Concentration'].values
    # perform an experiment to measure the response at these points
    # here we just simulate the response using the experimental data function
    # in a real experiment, you would measure the response at these points
    # and add the new points to the experimental data
    measured_yield = experimental_data(newT, newC)
    # add the new points to the experimental data
    bo.update_experiment(params   = {'Temperature':newT, 'Concentration':newC},
                         outcomes = {'Yield': measured_yield})

========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/botorch/optim/optimize.py:789: RuntimeWarning:

Optimization failed in `gen_candidates_scipy` with the following warning(s):
[OptimizationWarning('Optimization failed within `scipy.optimize.minimize` with status 2 and message ABNORMAL: .'), OptimizationWarning('Optimization failed within `scipy.optimize.minimize` with status 2 and message ABNORMAL: .')]
Trying again with a new set of initial conditions.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/botorch/optim/optimize.py:789: RuntimeWarning:

Optimization failed on the second try, after generating a new set of initial conditions.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/botorch/optim/optimize.py:789: RuntimeWarning:

Optimization failed in `gen_candidates_scipy` with the following warning(s):
[OptimizationWarning('Optimization failed within `scipy.optimize.minimize` with status 2 and message ABNORMAL: .')]
Trying again with a new set of initial conditions.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/botorch/optim/optimize.py:789: RuntimeWarning:

Optimization failed in `gen_candidates_scipy` with the following warning(s):
[OptimizationWarning('Optimization failed within `scipy.optimize.minimize` with status 2 and message ABNORMAL: .'), OptimizationWarning('Optimization failed within `scipy.optimize.minimize` with status 2 and message ABNORMAL: .'), OptimizationWarning('Optimization failed within `scipy.optimize.minimize` with status 2 and message ABNORMAL: .')]
Trying again with a new set of initial conditions.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/botorch/optim/optimize.py:789: RuntimeWarning:

Optimization failed on the second try, after generating a new set of initial conditions.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/botorch/optim/optimize.py:789: RuntimeWarning:

Optimization failed in `gen_candidates_scipy` with the following warning(s):
[OptimizationWarning('Optimization failed within `scipy.optimize.minimize` with status 2 and message ABNORMAL: .'), OptimizationWarning('Optimization failed within `scipy.optimize.minimize` with status 2 and message ABNORMAL: .'), OptimizationWarning('Optimization failed within `scipy.optimize.minimize` with status 2 and message ABNORMAL: .'), OptimizationWarning('Optimization failed within `scipy.optimize.minimize` with status 2 and message ABNORMAL: .'), OptimizationWarning('Optimization failed within `scipy.optimize.minimize` with status 2 and message ABNORMAL: .'), OptimizationWarning('Optimization failed within `scipy.optimize.minimize` with status 2 and message ABNORMAL: .')]
Trying again with a new set of initial conditions.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/botorch/optim/optimize.py:789: RuntimeWarning:

Optimization failed on the second try, after generating a new set of initial conditions.

Now le’ts plot the model:

[10]:
bo.plot_model()
Arm 0_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 0<br>Concentration: 0
Arm 1_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 100<br>Concentration: 0
Arm 2_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 0<br>Concentration: 1
Arm 3_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 100<br>Concentration: 1
Arm 4_0<br>Yield: 0.00367679 (SEM: None)<br>Temperature: 99.7513<br>Concentration: 0.104366
Arm 5_0<br>Yield: 0.04197 (SEM: None)<br>Temperature: 11.1134<br>Concentration: 0.787977
Arm 6_0<br>Yield: 0.178529 (SEM: None)<br>Temperature: 36.5188<br>Concentration: 0.353275
Arm 7_0<br>Yield: 0.537695 (SEM: None)<br>Temperature: 74.345<br>Concentration: 0.537097
Arm 8_0<br>Yield: 0.779679 (SEM: None)<br>Temperature: 58.2254<br>Concentration: 0.487801
Arm 9_0<br>Yield: 0.200472 (SEM: None)<br>Temperature: 46.1438<br>Concentration: 0.687249
Arm 10_0<br>Yield: 0.709148 (SEM: None)<br>Temperature: 62.9207<br>Concentration: 0.420083
Arm 11_0<br>Yield: 0.00591348 (SEM: None)<br>Temperature: 59.0451<br>Concentration: 1
Arm 12_0<br>Yield: 0.807053 (SEM: None)<br>Temperature: 62.013<br>Concentration: 0.529202
Arm 13_0<br>Yield: 0.722291 (SEM: None)<br>Temperature: 62.6611<br>Concentration: 0.579499
Arm 14_0<br>Yield: 0.819951 (SEM: None)<br>Temperature: 61.5189<br>Concentration: 0.501271
Arm 15_0<br>Yield: 0.0725179 (SEM: None)<br>Temperature: 0<br>Concentration: 0.421285
Arm 16_0<br>Yield: -0.00499055 (SEM: None)<br>Temperature: 50.3894<br>Concentration: 0
Arm 17_0<br>Yield: 0.812068 (SEM: None)<br>Temperature: 62.8948<br>Concentration: 0.50195
Arm 18_0<br>Yield: 0.817573 (SEM: None)<br>Temperature: 60.3554<br>Concentration: 0.507755
Arm 19_0<br>Yield: 0.00423865 (SEM: None)<br>Temperature: 29.5381<br>Concentration: 1
Arm 20_0<br>Yield: 0.0820846 (SEM: None)<br>Temperature: 100<br>Concentration: 0.500489
Arm 21_0<br>Yield: 0.00331946 (SEM: None)<br>Temperature: 25.0013<br>Concentration: 0
Arm 22_0<br>Yield: 0.81891 (SEM: None)<br>Temperature: 61.7243<br>Concentration: 0.509245
Arm 23_0<br>Yield: 0.00346642 (SEM: None)<br>Temperature: 75.7737<br>Concentration: 0
Arm 24_0<br>Yield: 0.817312 (SEM: None)<br>Temperature: 62.2059<br>Concentration: 0.501012
Arm 25_0<br>Yield: 0.415896 (SEM: None)<br>Temperature: 20.9281<br>Concentration: 0.536392
Arm 26_0<br>Yield: 0.81635 (SEM: None)<br>Temperature: 62.3238<br>Concentration: 0.506729
Arm 27_0<br>Yield: 0.0245297 (SEM: None)<br>Temperature: 100<br>Concentration: 0.745751
Arm 28_0<br>Yield: 0.112724 (SEM: None)<br>Temperature: 15.4432<br>Concentration: 0.277746
Arm 29_0<br>Yield: 0.00276789 (SEM: None)<br>Temperature: 79.8273<br>Concentration: 1
Arm 30_0<br>Yield: 0.819788 (SEM: None)<br>Temperature: 61.1677<br>Concentration: 0.509239
Arm 31_0<br>Yield: 0.818814 (SEM: None)<br>Temperature: 61.9057<br>Concentration: 0.504719
Arm 32_0<br>Yield: 0.815113 (SEM: None)<br>Temperature: 62.5337<br>Concentration: 0.500933
Arm 33_0<br>Yield: 0.818982 (SEM: None)<br>Temperature: 61.8593<br>Concentration: 0.501003
Arm 0_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 0<br>Concentration: 0
Arm 1_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 100<br>Concentration: 0
Arm 2_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 0<br>Concentration: 1
Arm 3_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 100<br>Concentration: 1
Arm 4_0<br>Yield: 0.00367679 (SEM: None)<br>Temperature: 99.7513<br>Concentration: 0.104366
Arm 5_0<br>Yield: 0.04197 (SEM: None)<br>Temperature: 11.1134<br>Concentration: 0.787977
Arm 6_0<br>Yield: 0.178529 (SEM: None)<br>Temperature: 36.5188<br>Concentration: 0.353275
Arm 7_0<br>Yield: 0.537695 (SEM: None)<br>Temperature: 74.345<br>Concentration: 0.537097
Arm 8_0<br>Yield: 0.779679 (SEM: None)<br>Temperature: 58.2254<br>Concentration: 0.487801
Arm 9_0<br>Yield: 0.200472 (SEM: None)<br>Temperature: 46.1438<br>Concentration: 0.687249
Arm 10_0<br>Yield: 0.709148 (SEM: None)<br>Temperature: 62.9207<br>Concentration: 0.420083
Arm 11_0<br>Yield: 0.00591348 (SEM: None)<br>Temperature: 59.0451<br>Concentration: 1
Arm 12_0<br>Yield: 0.807053 (SEM: None)<br>Temperature: 62.013<br>Concentration: 0.529202
Arm 13_0<br>Yield: 0.722291 (SEM: None)<br>Temperature: 62.6611<br>Concentration: 0.579499
Arm 14_0<br>Yield: 0.819951 (SEM: None)<br>Temperature: 61.5189<br>Concentration: 0.501271
Arm 15_0<br>Yield: 0.0725179 (SEM: None)<br>Temperature: 0<br>Concentration: 0.421285
Arm 16_0<br>Yield: -0.00499055 (SEM: None)<br>Temperature: 50.3894<br>Concentration: 0
Arm 17_0<br>Yield: 0.812068 (SEM: None)<br>Temperature: 62.8948<br>Concentration: 0.50195
Arm 18_0<br>Yield: 0.817573 (SEM: None)<br>Temperature: 60.3554<br>Concentration: 0.507755
Arm 19_0<br>Yield: 0.00423865 (SEM: None)<br>Temperature: 29.5381<br>Concentration: 1
Arm 20_0<br>Yield: 0.0820846 (SEM: None)<br>Temperature: 100<br>Concentration: 0.500489
Arm 21_0<br>Yield: 0.00331946 (SEM: None)<br>Temperature: 25.0013<br>Concentration: 0
Arm 22_0<br>Yield: 0.81891 (SEM: None)<br>Temperature: 61.7243<br>Concentration: 0.509245
Arm 23_0<br>Yield: 0.00346642 (SEM: None)<br>Temperature: 75.7737<br>Concentration: 0
Arm 24_0<br>Yield: 0.817312 (SEM: None)<br>Temperature: 62.2059<br>Concentration: 0.501012
Arm 25_0<br>Yield: 0.415896 (SEM: None)<br>Temperature: 20.9281<br>Concentration: 0.536392
Arm 26_0<br>Yield: 0.81635 (SEM: None)<br>Temperature: 62.3238<br>Concentration: 0.506729
Arm 27_0<br>Yield: 0.0245297 (SEM: None)<br>Temperature: 100<br>Concentration: 0.745751
Arm 28_0<br>Yield: 0.112724 (SEM: None)<br>Temperature: 15.4432<br>Concentration: 0.277746
Arm 29_0<br>Yield: 0.00276789 (SEM: None)<br>Temperature: 79.8273<br>Concentration: 1
Arm 30_0<br>Yield: 0.819788 (SEM: None)<br>Temperature: 61.1677<br>Concentration: 0.509239
Arm 31_0<br>Yield: 0.818814 (SEM: None)<br>Temperature: 61.9057<br>Concentration: 0.504719
Arm 32_0<br>Yield: 0.815113 (SEM: None)<br>Temperature: 62.5337<br>Concentration: 0.500933
Arm 33_0<br>Yield: 0.818982 (SEM: None)<br>Temperature: 61.8593<br>Concentration: 0.501003
[11]:
print(f"Best parameters from BO:")
print(bo.get_best_parameters())
print(f"Expected best parameters:")
print(pd.DataFrame({'Temperature': max_temp, 'Concentration': max_conc, 'Yield':max_yield}, index=[0]))
Best parameters from BO:
   Temperature  Concentration     Yield
0    61.518915       0.501271  0.819951
Expected best parameters:
   Temperature  Concentration     Yield
0    61.322645       0.503006  0.820258

And the convergence plot: we see here that the maximum was found after the 13th iteration. You can play on the number of random points to see how it affects the convergence.

[12]:
bo.plot_optimization_trace(optimum=max_yield)

Two outcomes#

First, we generate some data#

Like before, we will generate some data. We will use the same function for the yield, and andd another function for the price of the experiment: we will want to maximize rthe yield and minimize the price. The price is a function of the temperature and concentration, but it is not a function of the yield.

[13]:
from plotly.subplots import make_subplots

def price(temp, conc):
    """
    This function simulates the price of the experiment.
    """
    out = (np.exp(-((temp - 45) ** 2)/2000)*np.exp(-((conc - .350) ** 2)/.08)-1.2*np.exp(-((temp - 55) ** 2)/150)*np.exp(-((conc - .250) ** 2)/.05))*100+150
    return out

def generate_data(N=100):
    temp = np.linspace(0, 100, N)
    conc = np.linspace(0, 1, N)
    data = np.meshgrid(temp, conc)
    temp, conc = data[0].flatten(), data[1].flatten()
    exp_data = experimental_data(temp, conc)
    price_data = price(temp, conc)
    df = pd.DataFrame({'Temperature': temp, 'Concentration': conc, 'Yield': exp_data, 'Price': price_data})
    return df

df = generate_data(500)

# Prepare data for 3D surface plot
unique_temps = np.unique(df['Temperature'])
unique_concs = np.unique(df['Concentration'])
Z = df.pivot(index='Concentration', columns='Temperature', values='Yield').values
ZZ = df.pivot(index='Concentration', columns='Temperature', values='Price').values
# find the maximum yield and its position
max_yield = np.max(Z)
max_pos = np.unravel_index(np.argmax(Z), Z.shape)
max_temp = unique_temps[max_pos[1]]
max_conc = unique_concs[max_pos[0]]
# min price
min_price = np.min(ZZ)
min_pos = np.unravel_index(np.argmin(ZZ), ZZ.shape)
minp_temp = unique_temps[min_pos[1]]
minp_conc = unique_concs[min_pos[0]]

# Create the subplots
fig = make_subplots(rows=1, cols=2, subplot_titles=('Yield', 'Price'))

# Add the contour plot for Yield (Z)
fig.add_trace(
    go.Contour(
        z=Z,
        x=unique_temps,
        y=unique_concs,
        colorscale='Viridis',
        contours=dict(coloring='heatmap', size=0.1),
        hovertemplate='Temperature: %{x}<br>Concentration: %{y}<br>Yield: %{z}<extra></extra>'
    ),
    row=1, col=1
)

# Add the contour plot for Price (ZZ)
fig.add_trace(
    go.Contour(
        z=ZZ,
        x=unique_temps,
        y=unique_concs,
        colorscale='Viridis',
        contours=dict(coloring='heatmap', size=0.1),
        hovertemplate='Temperature: %{x}<br>Concentration: %{y}<br>Price: %{z}<extra></extra>'
    ),
    row=1, col=2
)

# Update layout with legend at the top, below the title
fig.update_layout(
    xaxis_title='Temperature',
    yaxis_title='Concentration',
    xaxis2_title='Temperature',
    yaxis2_title='Concentration',
    legend=dict(
        x=0.5,  # Center the legend horizontally
        y=1.05,  # Place the legend just below the title
        orientation='h',  # Horizontal orientation
        xanchor='center',
        yanchor='bottom'
    )
)

# Add a marker for the maximum yield
fig.add_trace(
    go.Scatter(
        x=[max_temp],
        y=[max_conc],
        mode='markers',
        marker=dict(size=10, color='red', symbol='x'),
        name='Max Yield',
        customdata=[[max_yield]],  # Add max_yield as custom data
        hovertemplate='Max Yield:<br>Temperature: %{x}<br>Concentration: %{y}<br>Yield: %{customdata[0]}<extra></extra>'
    ),
    row=1, col=1
)

# Add a marker for the minimum price
fig.add_trace(
    go.Scatter(
        x=[minp_temp],
        y=[minp_conc],
        mode='markers',
        marker=dict(size=10, color='orange', symbol='x'),
        name='Min Price',
        customdata=[[min_price]],  # Add min_price as custom data
        hovertemplate='Min Price:<br>Temperature: %{x}<br>Concentration: %{y}<br>Price: %{customdata[0]}<extra></extra>'
    ),
    row=1, col=2
)

# Create some sample data
df_sample = generate_data(2)

# Add the experimental data on the plot for Yield
fig.add_trace(
    go.Scatter(
        x=df_sample['Temperature'],
        y=df_sample['Concentration'],
        mode='markers',
        marker=dict(size=10, color='white', symbol='circle',
                    line=dict(width=2, color='black')),
        name='Experimental Measurements (Yield)',
    ),
    row=1, col=1
)

# Add the experimental data on the plot for Price
fig.add_trace(
    go.Scatter(
        x=df_sample['Temperature'],
        y=df_sample['Concentration'],
        mode='markers',
        marker=dict(size=10, color='white', symbol='circle',
                    line=dict(width=2, color='black')),
        name='Experimental Measurements (Price)',
    ),
    row=1, col=2
)

fig.show(config={'responsive': True})

df_sample.to_csv('experimental_data2.csv', index=False)

Let’s now read the experimental data and create our BOExperiment object. The data is in the same format as before, but we have two outcomes: yield and price. The features are the same as before, but we have to specify that we have two outcomes. We also have to specify the type of optimization: we want to maximize the yield and minimize the price.

[14]:
features, outcomes = read_experimental_data('experimental_data2.csv', out_pos=[-2,-1])
print(f"- Features:\n{features}")
print(f"- Outcomes:\n{outcomes}")
- Features:
{'Temperature': {'type': 'float', 'data': [0.0, 100.0, 0.0, 100.0], 'range': [np.float64(0.0), np.float64(100.0)]}, 'Concentration': {'type': 'float', 'data': [0.0, 0.0, 1.0, 1.0], 'range': [np.float64(0.0), np.float64(1.0)]}}
- Outcomes:
{'Yield': {'type': 'float', 'data': [0.0005530843449776, 0.0005530843701466, 0.0005530843667414, 0.0005530843701476]}, 'Price': {'type': 'float', 'data': [157.85712040284733, 154.76553732340065, 150.18478176220222, 150.11207580199311]}}
[15]:
bo = BOExperiment(
    features=features,
    outcomes=outcomes,
    N = 1, # number of new points to generate
    maximize={'Yield':True, 'Price':False}, # we want to maximize the response
    outcome_constraints=None,
    fixed_features=None, # fixed features are not used here
    # but they can be added as fixed_features = {Temperature: 50, Concentration: 0.5}
    feature_constraints=None, # feature constraints are not used here
    # but they can be added as
    # feature_constraints = ['Concentration + Temperature <= 200']
    optim = 'sobol', # sobol is used to randomly generate the new points
)
/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

[WARNING 06-02 08:32:29] ax.adapter.transforms.standardize_y: Outcome Yield is constant, within tolerance.

========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/botorch/models/utils/assorted.py:274: InputDataWarning:

Data (outcome observations) is not standardized (std = tensor([1.0000e+00, 1.2124e-11], dtype=torch.float64), mean = tensor([ 2.7756e-17, -8.1315e-20], dtype=torch.float64)).Please consider scaling the input to zero mean and unit variance.

Let’s do the optimization:

[16]:
for i in range(50): #let's do 50 iterations
    if i==6:
        bo.optim = 'bo' # change to BO optimization after 6 iterations
    # simulate the new points
    new = bo.suggest_next_trials(with_predicted=False)
    newT = new['Temperature'].values
    newC = new['Concentration'].values
    # perform an experiment to measure the response at these points
    # here we just simulate the response using the experimental data function
    # in a real experiment, you would measure the response at these points
    # and add the new points to the experimental data
    measured_yield = experimental_data(newT, newC)
    measured_price = price(newT, newC)
    # add the new points to the experimental data
    bo.update_experiment(params   = {'Temperature':newT, 'Concentration':newC},
                         outcomes = {'Yield': measured_yield, 'Price': measured_price})

========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.


========   INITIALIZING MODEL   ========

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

Now let’s plot the model:

[17]:
figs = [bo.plot_model(metricname=mname) for mname in bo.out_names]
for fig in figs:
    fig.show(config={'responsive': True})
Arm 0_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 0<br>Concentration: 0
Arm 1_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 100<br>Concentration: 0
Arm 2_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 0<br>Concentration: 1
Arm 3_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 100<br>Concentration: 1
Arm 4_0<br>Yield: 0.00367679 (SEM: None)<br>Temperature: 99.7513<br>Concentration: 0.104366
Arm 5_0<br>Yield: 0.04197 (SEM: None)<br>Temperature: 11.1134<br>Concentration: 0.787977
Arm 6_0<br>Yield: 0.178529 (SEM: None)<br>Temperature: 36.5188<br>Concentration: 0.353275
Arm 7_0<br>Yield: 0.537695 (SEM: None)<br>Temperature: 74.345<br>Concentration: 0.537097
Arm 8_0<br>Yield: 0.779679 (SEM: None)<br>Temperature: 58.2254<br>Concentration: 0.487801
Arm 9_0<br>Yield: 0.200472 (SEM: None)<br>Temperature: 46.1438<br>Concentration: 0.687249
Arm 10_0<br>Yield: 0.00572165 (SEM: None)<br>Temperature: 61.9469<br>Concentration: 1
Arm 11_0<br>Yield: 0.42708 (SEM: None)<br>Temperature: 59.7161<br>Concentration: 0.684229
Arm 12_0<br>Yield: 0.0124043 (SEM: None)<br>Temperature: 69.4691<br>Concentration: 0.0526211
Arm 13_0<br>Yield: 0.6701 (SEM: None)<br>Temperature: 60.0562<br>Concentration: 0.603948
Arm 14_0<br>Yield: 0.0519509 (SEM: None)<br>Temperature: 0<br>Concentration: 0.651238
Arm 15_0<br>Yield: 0.00332726 (SEM: None)<br>Temperature: 23.5576<br>Concentration: 1
Arm 16_0<br>Yield: 0.259867 (SEM: None)<br>Temperature: 57.345<br>Concentration: 0.741258
Arm 17_0<br>Yield: 0.00721247 (SEM: None)<br>Temperature: 79.4838<br>Concentration: 0.950702
Arm 18_0<br>Yield: 0.140832 (SEM: None)<br>Temperature: 62.6839<br>Concentration: 0.797885
Arm 19_0<br>Yield: 0.542298 (SEM: None)<br>Temperature: 60.371<br>Concentration: 0.647514
Arm 20_0<br>Yield: 0.332597 (SEM: None)<br>Temperature: 60.2117<br>Concentration: 0.716058
Arm 21_0<br>Yield: 0.00656364 (SEM: None)<br>Temperature: 0<br>Concentration: 0.855402
Arm 22_0<br>Yield: 0.00154306 (SEM: None)<br>Temperature: 11.6077<br>Concentration: 1
Arm 23_0<br>Yield: 0.760261 (SEM: None)<br>Temperature: 60.687<br>Concentration: 0.565296
Arm 24_0<br>Yield: 0.0238185 (SEM: None)<br>Temperature: 100<br>Concentration: 0.748726
Arm 25_0<br>Yield: -0.000627082 (SEM: None)<br>Temperature: 35.2375<br>Concentration: 0
Arm 26_0<br>Yield: 0.221791 (SEM: None)<br>Temperature: 67.834<br>Concentration: 0.743313
Arm 27_0<br>Yield: 0.00523387 (SEM: None)<br>Temperature: 0<br>Concentration: 0.129015
Arm 28_0<br>Yield: 0.01622 (SEM: None)<br>Temperature: 45.432<br>Concentration: 0.926354
Arm 29_0<br>Yield: 0.479219 (SEM: None)<br>Temperature: 63.0362<br>Concentration: 0.663857
Arm 30_0<br>Yield: 0.604126 (SEM: None)<br>Temperature: 61.4907<br>Concentration: 0.626621
Arm 31_0<br>Yield: 0.0814151 (SEM: None)<br>Temperature: 0<br>Concentration: 0.520241
Arm 32_0<br>Yield: 0.381508 (SEM: None)<br>Temperature: 63.8223<br>Concentration: 0.693909
Arm 33_0<br>Yield: 0.00454487 (SEM: None)<br>Temperature: 100<br>Concentration: 0.880378
Arm 34_0<br>Yield: 0.0807141 (SEM: None)<br>Temperature: 60.1092<br>Concentration: 0.843861
Arm 35_0<br>Yield: 0.183795 (SEM: None)<br>Temperature: 63.1075<br>Concentration: 0.773837
Arm 36_0<br>Yield: 0.00447365 (SEM: None)<br>Temperature: 45.3409<br>Concentration: 1
Arm 37_0<br>Yield: 0.712738 (SEM: None)<br>Temperature: 60.2432<br>Concentration: 0.587262
Arm 38_0<br>Yield: 0.0146694 (SEM: None)<br>Temperature: 16.0019<br>Concentration: 0.891525
Arm 39_0<br>Yield: 0.298053 (SEM: None)<br>Temperature: 63.7246<br>Concentration: 0.723841
Arm 40_0<br>Yield: 0.818064 (SEM: None)<br>Temperature: 60.4185<br>Concentration: 0.505524
Arm 41_0<br>Yield: 0.0281076 (SEM: None)<br>Temperature: 87.7916<br>Concentration: 0.827377
Arm 42_0<br>Yield: 0.737739 (SEM: None)<br>Temperature: 64.6345<br>Concentration: 0.443202
Arm 43_0<br>Yield: 0.637179 (SEM: None)<br>Temperature: 61.3371<br>Concentration: 0.61557
Arm 44_0<br>Yield: 0.00192461 (SEM: None)<br>Temperature: 85.3982<br>Concentration: 0
Arm 45_0<br>Yield: 0.00142397 (SEM: None)<br>Temperature: 89.4247<br>Concentration: 1
Arm 46_0<br>Yield: 0.0800898 (SEM: None)<br>Temperature: 100<br>Concentration: 0.464924
Arm 47_0<br>Yield: 0.00197413 (SEM: None)<br>Temperature: 14.9762<br>Concentration: 0
Arm 48_0<br>Yield: 0.00209064 (SEM: None)<br>Temperature: 56.2869<br>Concentration: 0
Arm 49_0<br>Yield: 0.0922858 (SEM: None)<br>Temperature: 54.6044<br>Concentration: 0.230293
Arm 50_0<br>Yield: 0.29772 (SEM: None)<br>Temperature: 55.3645<br>Concentration: 0.323436
Arm 51_0<br>Yield: 0.462386 (SEM: None)<br>Temperature: 56.1718<br>Concentration: 0.371109
Arm 52_0<br>Yield: 0.186393 (SEM: None)<br>Temperature: 54.665<br>Concentration: 0.286685
Arm 53_0<br>Yield: 0.588638 (SEM: None)<br>Temperature: 57.1881<br>Concentration: 0.401825
Arm 0_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 0<br>Concentration: 0
Arm 1_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 100<br>Concentration: 0
Arm 2_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 0<br>Concentration: 1
Arm 3_0<br>Yield: 0.000553084 (SEM: None)<br>Temperature: 100<br>Concentration: 1
Arm 4_0<br>Yield: 0.00367679 (SEM: None)<br>Temperature: 99.7513<br>Concentration: 0.104366
Arm 5_0<br>Yield: 0.04197 (SEM: None)<br>Temperature: 11.1134<br>Concentration: 0.787977
Arm 6_0<br>Yield: 0.178529 (SEM: None)<br>Temperature: 36.5188<br>Concentration: 0.353275
Arm 7_0<br>Yield: 0.537695 (SEM: None)<br>Temperature: 74.345<br>Concentration: 0.537097
Arm 8_0<br>Yield: 0.779679 (SEM: None)<br>Temperature: 58.2254<br>Concentration: 0.487801
Arm 9_0<br>Yield: 0.200472 (SEM: None)<br>Temperature: 46.1438<br>Concentration: 0.687249
Arm 10_0<br>Yield: 0.00572165 (SEM: None)<br>Temperature: 61.9469<br>Concentration: 1
Arm 11_0<br>Yield: 0.42708 (SEM: None)<br>Temperature: 59.7161<br>Concentration: 0.684229
Arm 12_0<br>Yield: 0.0124043 (SEM: None)<br>Temperature: 69.4691<br>Concentration: 0.0526211
Arm 13_0<br>Yield: 0.6701 (SEM: None)<br>Temperature: 60.0562<br>Concentration: 0.603948
Arm 14_0<br>Yield: 0.0519509 (SEM: None)<br>Temperature: 0<br>Concentration: 0.651238
Arm 15_0<br>Yield: 0.00332726 (SEM: None)<br>Temperature: 23.5576<br>Concentration: 1
Arm 16_0<br>Yield: 0.259867 (SEM: None)<br>Temperature: 57.345<br>Concentration: 0.741258
Arm 17_0<br>Yield: 0.00721247 (SEM: None)<br>Temperature: 79.4838<br>Concentration: 0.950702
Arm 18_0<br>Yield: 0.140832 (SEM: None)<br>Temperature: 62.6839<br>Concentration: 0.797885
Arm 19_0<br>Yield: 0.542298 (SEM: None)<br>Temperature: 60.371<br>Concentration: 0.647514
Arm 20_0<br>Yield: 0.332597 (SEM: None)<br>Temperature: 60.2117<br>Concentration: 0.716058
Arm 21_0<br>Yield: 0.00656364 (SEM: None)<br>Temperature: 0<br>Concentration: 0.855402
Arm 22_0<br>Yield: 0.00154306 (SEM: None)<br>Temperature: 11.6077<br>Concentration: 1
Arm 23_0<br>Yield: 0.760261 (SEM: None)<br>Temperature: 60.687<br>Concentration: 0.565296
Arm 24_0<br>Yield: 0.0238185 (SEM: None)<br>Temperature: 100<br>Concentration: 0.748726
Arm 25_0<br>Yield: -0.000627082 (SEM: None)<br>Temperature: 35.2375<br>Concentration: 0
Arm 26_0<br>Yield: 0.221791 (SEM: None)<br>Temperature: 67.834<br>Concentration: 0.743313
Arm 27_0<br>Yield: 0.00523387 (SEM: None)<br>Temperature: 0<br>Concentration: 0.129015
Arm 28_0<br>Yield: 0.01622 (SEM: None)<br>Temperature: 45.432<br>Concentration: 0.926354
Arm 29_0<br>Yield: 0.479219 (SEM: None)<br>Temperature: 63.0362<br>Concentration: 0.663857
Arm 30_0<br>Yield: 0.604126 (SEM: None)<br>Temperature: 61.4907<br>Concentration: 0.626621
Arm 31_0<br>Yield: 0.0814151 (SEM: None)<br>Temperature: 0<br>Concentration: 0.520241
Arm 32_0<br>Yield: 0.381508 (SEM: None)<br>Temperature: 63.8223<br>Concentration: 0.693909
Arm 33_0<br>Yield: 0.00454487 (SEM: None)<br>Temperature: 100<br>Concentration: 0.880378
Arm 34_0<br>Yield: 0.0807141 (SEM: None)<br>Temperature: 60.1092<br>Concentration: 0.843861
Arm 35_0<br>Yield: 0.183795 (SEM: None)<br>Temperature: 63.1075<br>Concentration: 0.773837
Arm 36_0<br>Yield: 0.00447365 (SEM: None)<br>Temperature: 45.3409<br>Concentration: 1
Arm 37_0<br>Yield: 0.712738 (SEM: None)<br>Temperature: 60.2432<br>Concentration: 0.587262
Arm 38_0<br>Yield: 0.0146694 (SEM: None)<br>Temperature: 16.0019<br>Concentration: 0.891525
Arm 39_0<br>Yield: 0.298053 (SEM: None)<br>Temperature: 63.7246<br>Concentration: 0.723841
Arm 40_0<br>Yield: 0.818064 (SEM: None)<br>Temperature: 60.4185<br>Concentration: 0.505524
Arm 41_0<br>Yield: 0.0281076 (SEM: None)<br>Temperature: 87.7916<br>Concentration: 0.827377
Arm 42_0<br>Yield: 0.737739 (SEM: None)<br>Temperature: 64.6345<br>Concentration: 0.443202
Arm 43_0<br>Yield: 0.637179 (SEM: None)<br>Temperature: 61.3371<br>Concentration: 0.61557
Arm 44_0<br>Yield: 0.00192461 (SEM: None)<br>Temperature: 85.3982<br>Concentration: 0
Arm 45_0<br>Yield: 0.00142397 (SEM: None)<br>Temperature: 89.4247<br>Concentration: 1
Arm 46_0<br>Yield: 0.0800898 (SEM: None)<br>Temperature: 100<br>Concentration: 0.464924
Arm 47_0<br>Yield: 0.00197413 (SEM: None)<br>Temperature: 14.9762<br>Concentration: 0
Arm 48_0<br>Yield: 0.00209064 (SEM: None)<br>Temperature: 56.2869<br>Concentration: 0
Arm 49_0<br>Yield: 0.0922858 (SEM: None)<br>Temperature: 54.6044<br>Concentration: 0.230293
Arm 50_0<br>Yield: 0.29772 (SEM: None)<br>Temperature: 55.3645<br>Concentration: 0.323436
Arm 51_0<br>Yield: 0.462386 (SEM: None)<br>Temperature: 56.1718<br>Concentration: 0.371109
Arm 52_0<br>Yield: 0.186393 (SEM: None)<br>Temperature: 54.665<br>Concentration: 0.286685
Arm 53_0<br>Yield: 0.588638 (SEM: None)<br>Temperature: 57.1881<br>Concentration: 0.401825
Arm 0_0<br>Price: 157.857 (SEM: None)<br>Temperature: 0<br>Concentration: 0
Arm 1_0<br>Price: 154.766 (SEM: None)<br>Temperature: 100<br>Concentration: 0
Arm 2_0<br>Price: 150.185 (SEM: None)<br>Temperature: 0<br>Concentration: 1
Arm 3_0<br>Price: 150.112 (SEM: None)<br>Temperature: 100<br>Concentration: 1
Arm 4_0<br>Price: 160.508 (SEM: None)<br>Temperature: 99.7513<br>Concentration: 0.104366
Arm 5_0<br>Price: 155.12 (SEM: None)<br>Temperature: 11.1134<br>Concentration: 0.787977
Arm 6_0<br>Price: 236.509 (SEM: None)<br>Temperature: 36.5188<br>Concentration: 0.353275
Arm 7_0<br>Price: 190.069 (SEM: None)<br>Temperature: 74.345<br>Concentration: 0.537097
Arm 8_0<br>Price: 186.135 (SEM: None)<br>Temperature: 58.2254<br>Concentration: 0.487801
Arm 9_0<br>Price: 172.56 (SEM: None)<br>Temperature: 46.1438<br>Concentration: 0.687249
Arm 10_0<br>Price: 150.439 (SEM: None)<br>Temperature: 61.9469<br>Concentration: 1
Arm 11_0<br>Price: 169.827 (SEM: None)<br>Temperature: 59.7161<br>Concentration: 0.684229
Arm 12_0<br>Price: 160.907 (SEM: None)<br>Temperature: 69.4691<br>Concentration: 0.0526211
Arm 13_0<br>Price: 181.613 (SEM: None)<br>Temperature: 60.0562<br>Concentration: 0.603948
Arm 14_0<br>Price: 161.686 (SEM: None)<br>Temperature: 0<br>Concentration: 0.651238
Arm 15_0<br>Price: 150.404 (SEM: None)<br>Temperature: 23.5576<br>Concentration: 1
Arm 16_0<br>Price: 162.746 (SEM: None)<br>Temperature: 57.345<br>Concentration: 0.741258
Arm 17_0<br>Price: 150.606 (SEM: None)<br>Temperature: 79.4838<br>Concentration: 0.950702
Arm 18_0<br>Price: 156.768 (SEM: None)<br>Temperature: 62.6839<br>Concentration: 0.797885
Arm 19_0<br>Price: 175.19 (SEM: None)<br>Temperature: 60.371<br>Concentration: 0.647514
Arm 20_0<br>Price: 165.385 (SEM: None)<br>Temperature: 60.2117<br>Concentration: 0.716058
Arm 21_0<br>Price: 151.491 (SEM: None)<br>Temperature: 0<br>Concentration: 0.855402
Arm 22_0<br>Price: 150.291 (SEM: None)<br>Temperature: 11.6077<br>Concentration: 1
Arm 23_0<br>Price: 186.292 (SEM: None)<br>Temperature: 60.687<br>Concentration: 0.565296
Arm 24_0<br>Price: 153.02 (SEM: None)<br>Temperature: 100<br>Concentration: 0.748726
Arm 25_0<br>Price: 168.076 (SEM: None)<br>Temperature: 35.2375<br>Concentration: 0
Arm 26_0<br>Price: 160.835 (SEM: None)<br>Temperature: 67.834<br>Concentration: 0.743313
Arm 27_0<br>Price: 169.732 (SEM: None)<br>Temperature: 0<br>Concentration: 0.129015
Arm 28_0<br>Price: 151.566 (SEM: None)<br>Temperature: 45.432<br>Concentration: 0.926354
Arm 29_0<br>Price: 172.27 (SEM: None)<br>Temperature: 63.0362<br>Concentration: 0.663857
Arm 30_0<br>Price: 178.228 (SEM: None)<br>Temperature: 61.4907<br>Concentration: 0.626621
Arm 31_0<br>Price: 175.29 (SEM: None)<br>Temperature: 0<br>Concentration: 0.520241
Arm 32_0<br>Price: 167.711 (SEM: None)<br>Temperature: 63.8223<br>Concentration: 0.693909
Arm 33_0<br>Price: 150.655 (SEM: None)<br>Temperature: 100<br>Concentration: 0.880378
Arm 34_0<br>Price: 154.143 (SEM: None)<br>Temperature: 60.1092<br>Concentration: 0.843861
Arm 35_0<br>Price: 158.667 (SEM: None)<br>Temperature: 63.1075<br>Concentration: 0.773837
Arm 36_0<br>Price: 150.508 (SEM: None)<br>Temperature: 45.3409<br>Concentration: 1
Arm 37_0<br>Price: 183.779 (SEM: None)<br>Temperature: 60.2432<br>Concentration: 0.587262
Arm 38_0<br>Price: 151.681 (SEM: None)<br>Temperature: 16.0019<br>Concentration: 0.891525
Arm 39_0<br>Price: 163.817 (SEM: None)<br>Temperature: 63.7246<br>Concentration: 0.723841
Arm 40_0<br>Price: 188.892 (SEM: None)<br>Temperature: 60.4185<br>Concentration: 0.505524
Arm 41_0<br>Price: 152.319 (SEM: None)<br>Temperature: 87.7916<br>Concentration: 0.827377
Arm 42_0<br>Price: 193.348 (SEM: None)<br>Temperature: 64.6345<br>Concentration: 0.443202
Arm 43_0<br>Price: 179.898 (SEM: None)<br>Temperature: 61.3371<br>Concentration: 0.61557
Arm 44_0<br>Price: 159.491 (SEM: None)<br>Temperature: 85.3982<br>Concentration: 0
Arm 45_0<br>Price: 150.19 (SEM: None)<br>Temperature: 89.4247<br>Concentration: 1
Arm 46_0<br>Price: 168.682 (SEM: None)<br>Temperature: 100<br>Concentration: 0.464924
Arm 47_0<br>Price: 163.779 (SEM: None)<br>Temperature: 14.9762<br>Concentration: 0
Arm 48_0<br>Price: 136.289 (SEM: None)<br>Temperature: 56.2869<br>Concentration: 0
Arm 49_0<br>Price: 110.885 (SEM: None)<br>Temperature: 54.6044<br>Concentration: 0.230293
Arm 50_0<br>Price: 136.303 (SEM: None)<br>Temperature: 55.3645<br>Concentration: 0.323436
Arm 51_0<br>Price: 154.753 (SEM: None)<br>Temperature: 56.1718<br>Concentration: 0.371109
Arm 52_0<br>Price: 124.047 (SEM: None)<br>Temperature: 54.665<br>Concentration: 0.286685
Arm 53_0<br>Price: 166.477 (SEM: None)<br>Temperature: 57.1881<br>Concentration: 0.401825
Arm 0_0<br>Price: 157.857 (SEM: None)<br>Temperature: 0<br>Concentration: 0
Arm 1_0<br>Price: 154.766 (SEM: None)<br>Temperature: 100<br>Concentration: 0
Arm 2_0<br>Price: 150.185 (SEM: None)<br>Temperature: 0<br>Concentration: 1
Arm 3_0<br>Price: 150.112 (SEM: None)<br>Temperature: 100<br>Concentration: 1
Arm 4_0<br>Price: 160.508 (SEM: None)<br>Temperature: 99.7513<br>Concentration: 0.104366
Arm 5_0<br>Price: 155.12 (SEM: None)<br>Temperature: 11.1134<br>Concentration: 0.787977
Arm 6_0<br>Price: 236.509 (SEM: None)<br>Temperature: 36.5188<br>Concentration: 0.353275
Arm 7_0<br>Price: 190.069 (SEM: None)<br>Temperature: 74.345<br>Concentration: 0.537097
Arm 8_0<br>Price: 186.135 (SEM: None)<br>Temperature: 58.2254<br>Concentration: 0.487801
Arm 9_0<br>Price: 172.56 (SEM: None)<br>Temperature: 46.1438<br>Concentration: 0.687249
Arm 10_0<br>Price: 150.439 (SEM: None)<br>Temperature: 61.9469<br>Concentration: 1
Arm 11_0<br>Price: 169.827 (SEM: None)<br>Temperature: 59.7161<br>Concentration: 0.684229
Arm 12_0<br>Price: 160.907 (SEM: None)<br>Temperature: 69.4691<br>Concentration: 0.0526211
Arm 13_0<br>Price: 181.613 (SEM: None)<br>Temperature: 60.0562<br>Concentration: 0.603948
Arm 14_0<br>Price: 161.686 (SEM: None)<br>Temperature: 0<br>Concentration: 0.651238
Arm 15_0<br>Price: 150.404 (SEM: None)<br>Temperature: 23.5576<br>Concentration: 1
Arm 16_0<br>Price: 162.746 (SEM: None)<br>Temperature: 57.345<br>Concentration: 0.741258
Arm 17_0<br>Price: 150.606 (SEM: None)<br>Temperature: 79.4838<br>Concentration: 0.950702
Arm 18_0<br>Price: 156.768 (SEM: None)<br>Temperature: 62.6839<br>Concentration: 0.797885
Arm 19_0<br>Price: 175.19 (SEM: None)<br>Temperature: 60.371<br>Concentration: 0.647514
Arm 20_0<br>Price: 165.385 (SEM: None)<br>Temperature: 60.2117<br>Concentration: 0.716058
Arm 21_0<br>Price: 151.491 (SEM: None)<br>Temperature: 0<br>Concentration: 0.855402
Arm 22_0<br>Price: 150.291 (SEM: None)<br>Temperature: 11.6077<br>Concentration: 1
Arm 23_0<br>Price: 186.292 (SEM: None)<br>Temperature: 60.687<br>Concentration: 0.565296
Arm 24_0<br>Price: 153.02 (SEM: None)<br>Temperature: 100<br>Concentration: 0.748726
Arm 25_0<br>Price: 168.076 (SEM: None)<br>Temperature: 35.2375<br>Concentration: 0
Arm 26_0<br>Price: 160.835 (SEM: None)<br>Temperature: 67.834<br>Concentration: 0.743313
Arm 27_0<br>Price: 169.732 (SEM: None)<br>Temperature: 0<br>Concentration: 0.129015
Arm 28_0<br>Price: 151.566 (SEM: None)<br>Temperature: 45.432<br>Concentration: 0.926354
Arm 29_0<br>Price: 172.27 (SEM: None)<br>Temperature: 63.0362<br>Concentration: 0.663857
Arm 30_0<br>Price: 178.228 (SEM: None)<br>Temperature: 61.4907<br>Concentration: 0.626621
Arm 31_0<br>Price: 175.29 (SEM: None)<br>Temperature: 0<br>Concentration: 0.520241
Arm 32_0<br>Price: 167.711 (SEM: None)<br>Temperature: 63.8223<br>Concentration: 0.693909
Arm 33_0<br>Price: 150.655 (SEM: None)<br>Temperature: 100<br>Concentration: 0.880378
Arm 34_0<br>Price: 154.143 (SEM: None)<br>Temperature: 60.1092<br>Concentration: 0.843861
Arm 35_0<br>Price: 158.667 (SEM: None)<br>Temperature: 63.1075<br>Concentration: 0.773837
Arm 36_0<br>Price: 150.508 (SEM: None)<br>Temperature: 45.3409<br>Concentration: 1
Arm 37_0<br>Price: 183.779 (SEM: None)<br>Temperature: 60.2432<br>Concentration: 0.587262
Arm 38_0<br>Price: 151.681 (SEM: None)<br>Temperature: 16.0019<br>Concentration: 0.891525
Arm 39_0<br>Price: 163.817 (SEM: None)<br>Temperature: 63.7246<br>Concentration: 0.723841
Arm 40_0<br>Price: 188.892 (SEM: None)<br>Temperature: 60.4185<br>Concentration: 0.505524
Arm 41_0<br>Price: 152.319 (SEM: None)<br>Temperature: 87.7916<br>Concentration: 0.827377
Arm 42_0<br>Price: 193.348 (SEM: None)<br>Temperature: 64.6345<br>Concentration: 0.443202
Arm 43_0<br>Price: 179.898 (SEM: None)<br>Temperature: 61.3371<br>Concentration: 0.61557
Arm 44_0<br>Price: 159.491 (SEM: None)<br>Temperature: 85.3982<br>Concentration: 0
Arm 45_0<br>Price: 150.19 (SEM: None)<br>Temperature: 89.4247<br>Concentration: 1
Arm 46_0<br>Price: 168.682 (SEM: None)<br>Temperature: 100<br>Concentration: 0.464924
Arm 47_0<br>Price: 163.779 (SEM: None)<br>Temperature: 14.9762<br>Concentration: 0
Arm 48_0<br>Price: 136.289 (SEM: None)<br>Temperature: 56.2869<br>Concentration: 0
Arm 49_0<br>Price: 110.885 (SEM: None)<br>Temperature: 54.6044<br>Concentration: 0.230293
Arm 50_0<br>Price: 136.303 (SEM: None)<br>Temperature: 55.3645<br>Concentration: 0.323436
Arm 51_0<br>Price: 154.753 (SEM: None)<br>Temperature: 56.1718<br>Concentration: 0.371109
Arm 52_0<br>Price: 124.047 (SEM: None)<br>Temperature: 54.665<br>Concentration: 0.286685
Arm 53_0<br>Price: 166.477 (SEM: None)<br>Temperature: 57.1881<br>Concentration: 0.401825

The get_best_parameters() function returns the best parameters found so far. In the case of multiple outcomes, it will be an ensemble of points.

[18]:
bo.get_best_parameters()
/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/ax/adapter/transforms/winsorize.py:123: AxOptimizationWarning:

Encountered a `MultiObjective` without objective thresholds. We will winsorize each objective separately. We strongly recommend specifying the objective thresholds when using multi-objective optimization.

[INFO 06-02 08:34:35] ax.service.utils.best_point: Using inferred objective thresholds: [ObjectiveThreshold(Price <= 196.78655372854666), ObjectiveThreshold(Yield >= 0.017945701447308587)], as objective thresholds were not specified as part of the optimization configuration on the experiment.
[18]:
Temperature Concentration Price Yield
0 56.171837 0.371109 154.686393 0.465350
1 57.188107 0.401825 166.514346 0.583313
2 55.364503 0.323436 136.445624 0.297151
3 54.664974 0.286685 123.946026 0.189434
4 61.490677 0.626621 178.198748 0.604501
5 61.337140 0.615570 179.880041 0.637465
6 60.056181 0.603948 181.629831 0.669629
7 60.243224 0.587262 183.802126 0.712475
8 58.225436 0.487801 186.023734 0.785217
9 54.604362 0.230293 110.908437 0.090265
10 60.418465 0.505524 188.979452 0.813462

You can also plot the Pareto frontier, and then decide what is the best compromise you are prepared to make between the two outcomes. The Pareto frontier is the set of points that are not dominated by any other point. A point is dominated if there is another point that is better in both outcomes.

Here, you basically see that there are two choices for you, either high yield and high price, or low yield and low price.

[19]:
bo.plot_pareto_frontier()