baybe.utils.dataframe.add_fake_results

baybe.utils.dataframe.add_fake_results(data: DataFrame, campaign: Campaign, good_reference_values: dict[str, list] | None = None, good_intervals: dict[str, tuple[float, float]] | None = None, bad_intervals: dict[str, tuple[float, float]] | None = None)[source]

Add fake results to a dataframe which was the result of a BayBE recommendation.

It is possible to specify “good” values, which will be given a better target value. With this, the algorithm can be driven towards certain optimal values whilst still being random. Useful for testing. Note that this does not return a new dataframe and that the dataframe is changed in-place.

Parameters:
  • data (DataFrame) – Output of the recommend function of a Campaign, see baybe.campaign.Campaign.recommend().

  • campaign (Campaign) – The corresponding campaign, providing configuration, targets, etc.

  • good_reference_values (Optional[dict[str, list]]) – A dictionary containing parameter names (= dict keys) and respective parameter values (= dict values) that specify what will be considered good parameter settings. Conditions for different parameters are connected via “and” logic, i.e. the targets will only get good values when all parameters have good reference values.

  • good_intervals (Optional[dict[str, tuple[float, float]]]) – A dictionary containing target names (= dict keys) and respective “good” target value ranges (= dict values) in the form of 2-tuples. Each target will be assigned a random value in its respective target range whenever the corresponding parameters meet the conditions specified through good_reference_values.

  • bad_intervals (Optional[dict[str, tuple[float, float]]]) – Analogous to good_intervals but covering the cases where the parameters lie outside the conditions specified through good_reference_values.

Raises:
  • ValueError – If good values for a parameter were specified, but this parameter is not part of the dataframe.

  • ValueError – If the target mode is unrecognized when trying to add fake values.

  • TypeError – If the entries in good_reference_values are not lists.

Return type:

None