# Add interaction features (example: product of top 2 numeric) if self.poly_degree >= 2 and len(self.numeric_features) >= 2: f1, f2 = self.numeric_features[0], self.numeric_features[1] X_transformed[f'f1_x_f2'] = X_transformed[f1] * X_transformed[f2]
# Fit encoder for categoricals if self.encode and self.categorical_features: self.encoder_ = OneHotEncoder(handle_unknown='ignore', sparse_output=False) self.encoder_.fit(X[self.categorical_features])
# Imputers and scalers self.num_imputer_ = SimpleImputer(strategy='median') self.cat_imputer_ = SimpleImputer(strategy='most_frequent') self.scaler_ = StandardScaler() if self.scale else None
# Add interaction features (example: product of top 2 numeric) if self.poly_degree >= 2 and len(self.numeric_features) >= 2: f1, f2 = self.numeric_features[0], self.numeric_features[1] X_transformed[f'f1_x_f2'] = X_transformed[f1] * X_transformed[f2]
# Fit encoder for categoricals if self.encode and self.categorical_features: self.encoder_ = OneHotEncoder(handle_unknown='ignore', sparse_output=False) self.encoder_.fit(X[self.categorical_features])
# Imputers and scalers self.num_imputer_ = SimpleImputer(strategy='median') self.cat_imputer_ = SimpleImputer(strategy='most_frequent') self.scaler_ = StandardScaler() if self.scale else None
You currently have no cars in your showroom. Browse our reviews here to start.
Please fill out your contact details below.