mlchem.ml.preprocessing.feature_transformation.polynomial_expansion

polynomial_expansion(dataframe: DataFrame, degree: int) DataFrame

Expand features of a DataFrame to polynomial features of a given degree.

Parameters:
  • dataframe (pandas.DataFrame) – Input DataFrame containing the original features.

  • degree (int) – Degree of the polynomial expansion.

Returns:

DataFrame containing the expanded polynomial features.

Return type:

pandas.DataFrame