baybe.utils.dataframe.fuzzy_row_match¶
- baybe.utils.dataframe.fuzzy_row_match(left_df: DataFrame, right_df: DataFrame, parameters: Sequence[Parameter])[source]¶
Match rows of the right dataframe to rows of the left dataframe.
This is useful for matching measurements to entries in the search space, e.g. to detect which ones have been measured. For categorical parameters, there needs to be an exact match with any of the allowed values. For numerical parameters, the points with the smallest deviation are considered.
Note
This function assumes that the dataframes contain only allowed values as specified in the parameter objects. No further validation to assert this is done.
- Parameters:
- Return type:
- Returns:
The index of the matching rows in
left_df
.- Raises:
ValueError – If either
left_df
orright_df
does not contain columns for each entry in parameters.