Browse our archive by

# 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]

# Process numeric features if self.numeric_features: num_data = self.num_imputer_.transform(X[self.numeric_features]) if self.scale: num_data = self.scaler_.transform(num_data) num_df = pd.DataFrame(num_data, columns=self.numeric_features, index=X.index) X_transformed = pd.concat([X_transformed, num_df], axis=1)

return self

# Fit numeric pipeline if self.numeric_features: self.num_imputer_.fit(X[self.numeric_features]) if self.scale: self.scaler_.fit(X[self.numeric_features])

def transform(self, X): X_transformed = pd.DataFrame(index=X.index)

# Imputers and scalers self.num_imputer_ = SimpleImputer(strategy='median') self.cat_imputer_ = SimpleImputer(strategy='most_frequent') self.scaler_ = StandardScaler() if self.scale else None

# 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])

Recently Aired

Fe Transformer Script Apr 2026

# 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]

# Process numeric features if self.numeric_features: num_data = self.num_imputer_.transform(X[self.numeric_features]) if self.scale: num_data = self.scaler_.transform(num_data) num_df = pd.DataFrame(num_data, columns=self.numeric_features, index=X.index) X_transformed = pd.concat([X_transformed, num_df], axis=1) FE Transformer Script

return self

# Fit numeric pipeline if self.numeric_features: self.num_imputer_.fit(X[self.numeric_features]) if self.scale: self.scaler_.fit(X[self.numeric_features]) # Add interaction features (example: product of top

def transform(self, X): X_transformed = pd.DataFrame(index=X.index) = 2 and len(self.numeric_features) &gt

# Imputers and scalers self.num_imputer_ = SimpleImputer(strategy='median') self.cat_imputer_ = SimpleImputer(strategy='most_frequent') self.scaler_ = StandardScaler() if self.scale else None

# 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])

One car dealership tries to make its monthly quota: 129 cars. It is way more chaotic than we expected.

Archive

We watch someone trying to score a win in a game whose rules are being made up as she plays. 

The story of Harold Washington and the white backlash that ensued when he became Chicago's first Black mayor.

Conversations across a divide: People who are outside a war zone check in with family, friends, and strangers inside.

Majid believed that if he could testify in court about what happened to him at a CIA black site, he would be given a break. Was he right?

The other day, longtime This American Life staffer Seth Lind told Ira Glass something that blew his mind. So he took Seth into the studio.