Complete the code to create a new feature by combining two existing features.
data['new_feature'] = data['feature1'] [1] data['feature2']
Adding two features creates a new combined feature that can capture more information.
Complete the code to scale features before training the model.
from sklearn.preprocessing import {{BLANK_1 }} scaler = [1]() data_scaled = scaler.fit_transform(data)
StandardScaler standardizes features by removing the mean and scaling to unit variance.
Fix the error in the code to select only numeric features for feature engineering.
numeric_features = data.select_dtypes(include=[1])The correct dtype to select numeric columns is 'number'.
Fill both blanks to create a dictionary of feature lengths for words longer than 3 characters.
lengths = {word: [1] for word in words if len(word) [2] 3 }We want the length of each word (len(word)) and only include words longer than 3 (len(word) > 3).
Fill all three blanks to filter features and create a dictionary of uppercase keys with values greater than zero.
result = { [1]: [2] for k, v in data.items() if v [3] 0 }Keys are converted to uppercase (k.upper()), values are kept as v, and only items with values greater than zero (v > 0) are included.