library.phases.phases_implementation.feature_analysis.feature_engineering.feature_engineering module

class library.phases.phases_implementation.feature_analysis.feature_engineering.feature_engineering.FeatureEngineering(dataset: Dataset)[source]

Bases: object

polynomial_interaction_effects(degree: int = 2, interaction_only: bool = False, standarize: bool = False, scaler: str = 'standard')[source]

Generates polynomial and interaction features for the dataset.

Parameters:
  • degree (int, optional (default=2)) – The degree of the polynomial features.

  • interaction_only (bool, optional (default=False)) – If True, only interaction features are produced: features that are products of at most degree distinct input features, without powers of single features.

  • standarize (bool, optional (default=False)) – Whether to standardize the resulting features after transformation.

  • scaler (str, optional (default="standard")) – Type of scaler to use if standarize is True (e.g., “standard” for StandardScaler).

Returns:

  • None.

  • Transforms the training, validation, and test feature sets by adding polynomial and interaction terms,

  • and optionally scales these new features. Updates the dataset’s feature DataFrames in place.

  • Prints the number of new features added.