RecommenderProtocol

class baybe.recommenders.base.RecommenderProtocol[source]

Bases: Protocol

Type protocol specifying the interface recommenders need to implement.

Public methods

__init__(*args, **kwargs)

recommend(batch_size, searchspace, ...)

Recommend a batch of points from the given search space.

__init__(*args, **kwargs)
recommend(batch_size: int, searchspace: SearchSpace, objective: Objective | None, measurements: DataFrame | None)[source]

Recommend a batch of points from the given search space.

Parameters:
  • batch_size (int) – The number of points to be recommended.

  • searchspace (SearchSpace) – The search space from which to recommend the points.

  • objective (Objective | None) – An optional objective to be optimized.

  • measurements (DataFrame | None) – Optional experimentation data that can be used for model training. The data is to be provided in “experimental representation”: It needs to contain one column for each parameter spanning the search space (column name matching the parameter name) and one column for each target tracked by the objective (column name matching the target name). Each row corresponds to one conducted experiment, where the parameter columns define the experimental setting and the target columns report the measured outcomes.

Return type:

DataFrame

Returns:

A dataframe containing the recommendations in experimental representation as individual rows.