baybe.utils.dataframe.add_parameter_noise¶
- baybe.utils.dataframe.add_parameter_noise(data: DataFrame, parameters: Iterable[Parameter], noise_type: Literal['absolute', 'relative_percent'] = 'absolute', noise_level: float = 1.0)[source]¶
Apply uniform noise to the parameter values of a recommendation frame.
The noise can be additive or multiplicative. This can be used to simulate experimental noise or imperfect user input containing numerical parameter values that differ from the recommendations. Note that the dataframe is changed in-place and also returned.
- Parameters:
data (
DataFrame) – Output of therecommendfunction of aCampaignobject, seebaybe.campaign.Campaign.recommend().parameters (
Iterable[Parameter]) – The parameters for which the values shall be corrupted.noise_type (
Literal['absolute','relative_percent']) – Defines whether the noise should be additive or multiplicative.noise_level (
float) – Level/magnitude of the noise. Must be provided as numerical value for noise typeabsoluteand as percentage for noise typerelative_percent.
- Return type:
- Returns:
The modified dataframe.
- Raises:
ValueError – If
noise_typeis neitherabsolutenorrelative_percent.