baybe.utils.validation.preprocess_dataframe¶
- baybe.utils.validation.preprocess_dataframe(df: DataFrame, /, parameters: Sequence[Parameter], objective: Objective | None = None, numerical_measurements_must_be_within_tolerance: bool = True)[source]¶
Preprocess an experimental dataframe by validating and normalizing its contents.
Checks that the dataframe contains all required columns for the given parameters/objective and adjusts their dtypes accordingly.
- Parameters:
df (
DataFrame) – The dataframe to preprocess.parameters (
Sequence[Parameter]) – The parameters to validate the dataframe columns against.objective (
Optional[Objective]) – The objective to validate the dataframe columns against.numerical_measurements_must_be_within_tolerance (
bool) – Seevalidate_parameter_input().
- Return type:
- Returns:
The preprocessed dataframe.