Feature Engineering and Selection Flashcards
7 cards from real Data Science practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Feature Engineering and Selection flashcards as text
Target leakage in feature engineering occurs when a feature:
Answer: Contains information not available at prediction time
Leakage happens when a feature reveals future or target information unavailable during real prediction.
To avoid data leakage, feature scaling parameters should be fit on:
Answer: The training set only, then applied to the test set
Fitting scalers only on training data prevents test information from leaking into the pipeline.
Mean imputation of missing values can distort which property of a feature?
Answer: Its variance, which becomes artificially reduced
Replacing missing values with the mean shrinks variance and weakens correlations.
Creating a binary 'is_missing' indicator alongside imputation is useful because:
Answer: Missingness itself may be predictive
A missingness flag preserves the signal that a value was absent, which can be informative.
From a timestamp, which is a typical engineered feature?
Answer: Day of week or hour of day
Decomposing timestamps into components like day-of-week or hour exposes cyclical patterns.
Cyclical features like month are best encoded using:
Answer: Sine and cosine transformations
Sine/cosine encoding preserves the cyclical continuity so December is close to January.
Why standardize features before applying PCA?
Answer: So features with larger scales don't dominate the principal components
PCA is scale-sensitive, so standardization ensures each feature contributes comparably.