mlchem.ml.preprocessing.scaling.scale_df_minmax¶
- scale_df_minmax(df: DataFrame, last_columns_to_preserve: int = 0) tuple[DataFrame, MinMaxScaler]¶
Scale a DataFrame using min-max scaling, preserving specified columns.
- Parameters:
df (pandas.DataFrame) – The input DataFrame.
last_columns_to_preserve (int, default=0) – Number of columns at the end of the DataFrame to exclude from scaling.
- Returns:
The scaled DataFrame and the fitted MinMaxScaler.
- Return type:
tuple of pandas.DataFrame and MinMaxScaler