DSE Feature Engineering and Selection 2 — Questions and Answers
Question 1: Which technique creates new features by combining two or more existing features through multiplication or division?
- Feature hashing
- Interaction terms (Correct answer)
- Binning
- Imputation
Correct answer: Interaction terms
Interaction terms capture non-linear relationships by multiplying or dividing existing features to create new ones.
Question 2: What is the primary purpose of applying a log transformation to a skewed feature?
- To normalize categorical variables
- To reduce the impact of outliers and make the distribution more symmetric (Correct answer)
- To increase the number of features
- To encode missing values
Correct answer: To reduce the impact of outliers and make the distribution more symmetric
Log transformation compresses the range of large values, reducing skewness and the influence of extreme outliers.
Question 3: In the context of feature selection, what does the term 'multicollinearity' refer to?
- Missing values in multiple columns
- High correlation between two or more predictor features (Correct answer)
- Having too many categorical levels
- Low variance in a feature
Correct answer: High correlation between two or more predictor features
Multicollinearity occurs when predictor features are highly correlated with each other, making it difficult to isolate individual effects.
Question 4: Which encoding method is most appropriate for an ordinal categorical variable like 'education level' (High School < Bachelor's < Master's < PhD)?
- One-hot encoding
- Target encoding
- Ordinal encoding (Correct answer)
- Binary encoding
Correct answer: Ordinal encoding
Ordinal encoding assigns integer values that preserve the natural order of the categories.
Question 5: What is 'target leakage' in feature engineering?
- Using the target variable to impute missing values in training data only
- Including features that contain information not available at prediction time (Correct answer)
- Normalizing the target variable before training
- Splitting the target variable into multiple outputs
Correct answer: Including features that contain information not available at prediction time
Target leakage occurs when features used during training contain information that would not be available when the model makes real predictions.
Question 6: Which feature selection method uses a trained model's internal importance scores to rank and filter features?
- Filter method
- Wrapper method
- Embedded method (Correct answer)
- Correlation method
Correct answer: Embedded method
Embedded methods integrate feature selection into the model training process, using coefficients or importance scores produced by the model itself.
Question 7: When applying StandardScaler and then PCA for dimensionality reduction, why must StandardScaler be fit only on the training set?
- PCA requires integer inputs
- To prevent information from the test set from influencing the transformation parameters (Correct answer)
- StandardScaler cannot handle negative values
- PCA works only with scaled categorical features
Correct answer: To prevent information from the test set from influencing the transformation parameters
Fitting the scaler on the full dataset causes data leakage, as test set statistics influence the transformation applied during training.
Which technique creates new features by combining two or more existing features through multiplication or division?