mlchem.ml.preprocessing.scaling.scale_df_standard

scale_df_standard(df: DataFrame, last_columns_to_preserve: int = 0) tuple[DataFrame, StandardScaler]

Scale a DataFrame using standard 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 StandardScaler.

Return type:

tuple of pandas.DataFrame and StandardScaler