baybe.utils.augmentation.df_apply_mirror_augmentation¶
- baybe.utils.augmentation.df_apply_mirror_augmentation(df: DataFrame, column: str, *, mirror_point: float = 0.0)[source]¶
Augment a dataframe for a mirror invariant column.
- Parameters:
- Return type:
- Returns:
The augmented dataframe containing the original one. Augmented row indices are identical with the index of their original row.
Examples
>>> df = pd.DataFrame({'A':[1, 0, -2], 'B': [3, 4, 5]}) >>> df A B 0 1 3 1 0 4 2 -2 5
>>> dfa = df_apply_mirror_augmentation(df, "A") >>> dfa A B 0 1 3 0 -1 3 1 0 4 2 -2 5 2 2 5
>>> dfa = df_apply_mirror_augmentation(df, "A", mirror_point=1) >>> dfa A B 0 1 3 1 0 4 1 2 4 2 -2 5 2 4 5