Acquisition Functions

class edbo.acq_func.acquisition(function, batch_size=1, duplicates=False)

Class represents the main acquisition function module.

Class provides a container for different acquisition functions availible for Bayesian optimization.

__init__(function, batch_size=1, duplicates=False)
Parameters
  • function (str) – Acquisition function to be used. Options include: ‘TS’, ‘EI’, ‘PI’ ‘UCB’, ‘EI-TS’, ‘PI-TS’, ‘UCB-TS’, ‘rand-TS’, ‘MeanMax-TS’, ‘VarMax-TS’, ‘MeanMax’, ‘VarMax’, ‘rand’, and ‘eps-greedy’.

  • batch_size (int) – Number of points to select.

  • duplicates (bool) – Select duplicate domain points.

evaluate(model, obj)

Run the selected acquisition function.

Parameters
  • model (edbo.models) – Trained model.

  • obj (edbo.objective) – Objective object containining data and scalers.

Returns

Proposed experiments.

Return type

pandas.DataFrame

class edbo.acq_func.thompson_sampling(batch_size, duplicates, chunk_size=20000)

Class represents the Thompson sampling algorithm.

Provides a framework for selecting experimental conditions for parallel optimization via sampling the GP posterior predictive distribution.

__init__(batch_size, duplicates, chunk_size=20000)
Parameters
  • batch_size (int) – Number of points to select.

  • duplicates (bool) – Select duplicate domain points.

  • chunk_size (int) – Sampling over large spaces can be very costly. Therefore when TS if len(domain) > chunk_size the space is broken up into chunks, sampled, and concatenated together.

run(model, obj)

Run Thompson sampling algorithm on a trained model and user defined domain.

Parameters
  • model (edbo.models) – Trained model to be sampled.

  • obj (edbo.objective) – Objective object containing information about the domain.

Returns

Selected domain points.

Return type

pandas.DataFrame

class edbo.acq_func.top_predicted(batch_size, duplicates)

Class represents the batched pure exploitation algorithm.

Provides a framework for selecting experimental conditions for parallel optimization via the top predicted values.

__init__(batch_size, duplicates)
Parameters
  • batch_size (int) – Number of points to select.

  • duplicates (bool) – Select duplicate domain points.

run(model, obj)

Run top_predicted on a trained model and user defined domain.

Parameters
  • model (edbo.models) – Trained model to be sampled.

  • obj (edbo.objective) – Objective object containing information about the domain.

Returns

Selected domain points.

Return type

pandas.DataFrame

edbo.acq_func.mean(model, obj, **kwargs)

Compute model mean for Kriging believer pure exploitation.

Parameters
  • model (edbo.models) – Trained model.

  • obj (edbo.objective) – Objective object containing information about the domain.

  • jitter (float) – Parameter which controls the degree of exploration.

Returns

Computed mean at each domain point.

Return type

numpy.array

class edbo.acq_func.max_variance(batch_size, duplicates)

Class represents the batched pure exploration algorithm.

Provides a framework for selecting experimental conditions for parallel optimization via domain points with the highest model variance.

__init__(batch_size, duplicates)
Parameters
  • batch_size (int) – Number of points to select.

  • duplicates (bool) – Select duplicate domain points.

run(model, obj)

Run max_variance on a trained model and user defined domain.

Parameters
  • model (edbo.models) – Trained model to be sampled.

  • obj (edbo.objective) – Objective object containing information about the domain.

Returns

Selected domain points.

Return type

pandas.DataFrame

edbo.acq_func.variance(model, obj, **kwargs)

Compute model variance for Kriging believer pure exploration.

Parameters
  • model (edbo.models) – Trained model.

  • obj (edbo.objective) – Objective object containing information about the domain.

  • jitter (float) – Parameter which controls the degree of exploration.

Returns

Computed variance at each domain point.

Return type

numpy.array

edbo.acq_func.expected_improvement(model, obj, jitter=0.01)

Compute expected improvement.

EI attempts to balance exploration and exploitation by accounting for the amount of improvement over the best observed value.

Parameters
  • model (edbo.models) – Trained model.

  • obj (edbo.objective) – Objective object containing information about the domain.

  • jitter (float) – Parameter which controls the degree of exploration.

Returns

Computed EI at each domain point.

Return type

numpy.array

edbo.acq_func.probability_of_improvement(model, obj, jitter=0.01)

Compute probability of improvement.

PI favors exploitation of exporation. Equally rewards any improvement over the best observed value.

Parameters
  • model (edbo.models) – Trained model.

  • obj (edbo.objective) – Objective object containing information about the domain.

  • jitter (float) – Parameter which controls the degree of exploration.

Returns

Computed PI at each domain point.

Return type

numpy.array

edbo.acq_func.upper_confidence_bound(model, obj, jitter=0.01, delta=0.5)

Computes upper confidence bound.

Parameters
  • model (edbo.models) – Trained model.

  • obj (edbo.objective) – Objective object containing information about the domain.

  • jitter (float) – Parameter which controls the degree of exploration.

  • delta (float) – UCB parameter value.

Returns

Computed UCB at each domain point.

Return type

numpy.array

class edbo.acq_func.Kriging_believer(acq_function, batch_size, duplicates)

Class represents the Kriging believer algorithm.

Provides a framework for selecting experimental conditions for parallel optimization.

__init__(acq_function, batch_size, duplicates)
Parameters
  • acq_function (acq_func.function) – Base acquisition function to use with Kriging believer algorithm.

  • batch_size (int) – Number of points to select.

  • duplicates (bool) – Select duplicate domain points.

run(model, obj)

Run Kriging believer algorithm on a trained model and user defined domain.

Parameters
  • model (edbo.models) – Trained model to be sampled.

  • obj (edbo.objective) – Objective object containing information about the domain.

Returns

Selected domain points.

Return type

pandas.DataFrame

class edbo.acq_func.hybrid_TS(hybrid, batch_size, duplicates)

Class represents the hybrid Thompson sampling algorithm.

Provides a framework for selecting experimental conditions for parallel optimization via any acquisition funciton for the first sample and Thompson sampling for the remaining batch_size - 1 points.

__init__(hybrid, batch_size, duplicates)
Parameters
  • hybrid (edbo.acq_funcs:) – hybrid method to be used.

  • batch_size (int) – Number of points to select.

  • duplicates (bool) – Select duplicate domain points.

run(model, obj)

Run Hybrid-TS algorithm on a trained model and user defined domain.

Parameters
  • model (edbo.models) – Trained model to be sampled.

  • obj (edbo.objective) – Objective object containing information about the domain.

Returns

Selected domain points.

Return type

pandas.DataFrame

class edbo.acq_func.eps_greedy(batch_size, duplicates)

Class represents the pseudo epsilon-greedy acquisition policy.

Provides a framework for selecting experimental conditions for parallel optimization via the top predicted values with epsilon probability of random choices.

__init__(batch_size, duplicates)
Parameters
  • batch_size (int) – Number of points to select.

  • duplicates (bool) – Select duplicate domain points.

run(model, obj)

Run eps-greedy algorithm on a trained model and user defined domain.

Parameters
  • model (edbo.models) – Trained model to be sampled.

  • obj (edbo.objective) – Objective object containing information about the domain.

Returns

Selected domain points.

Return type

pandas.DataFrame

class edbo.acq_func.random(batch_size, duplicates)

Class represents the random selection algorithm.

Provides a random sampling method used for providing a baseline for simulations and evaluating the computation time of non-model components.

__init__(batch_size, duplicates)
Parameters
  • batch_size (int) – Number of points to select.

  • duplicates (bool) – Select duplicate domain points.

run(model, obj)

Run random sampling on a user defined domain.

Parameters
  • model (edbo.models) – Trained model to be sampled.

  • obj (edbo.objective) – Objective object containing information about the domain.

Returns

Selected domain points.

Return type

pandas.DataFrame