Feature Engineering & Selection MCQs for the NSCT
Feature engineering is the work of turning raw columns into inputs a model can learn from; feature selection is choosing which of those inputs to keep. It is topic 10 of the 17 in the AI / Machine Learning and Data Analytics area, which carries 10% of the NSCT according to HEC's Areas of Competencies. Candidates averaged 50.8% accuracy in this area in 2026, per the HEC NSCT report.
The topic builds on Data Collection & Pre-processing and EDA. Expect small counting questions (how many columns, how many models) and scenario questions about leakage.
Feature creation
Feature creation means deriving new variables, usually from domain knowledge, that expose a pattern the model cannot easily find on its own. The common moves are:
| Technique | Example | Why it helps |
|---|---|---|
| Ratio | BMI = weight / height² | One number captures what two columns only hint at |
| Interaction | total = price × quantity | Linear models cannot multiply features themselves |
| Polynomial | add x² to fit a U-shaped curve | A linear model in x² can fit curves |
| Log transform | log10(income) | Compresses a right-skewed tail |
| Binning | age → 0–17, 18–40, 41+ | Captures step changes, reduces noise |
| Date parts | day of week, month, is_holiday | Timestamps are useless as raw numbers |
| Cyclical encoding | sin and cos of 2π·hour/24 | Puts 23:00 next to 00:00 |
| Encoding | one-hot for nominal categories | Avoids a false order between categories |
A worked count: degree-2 polynomial expansion of n features, with the constant term, gives C(n + 2, 2) terms. For 2 features that is 6: 1, a, b, a², b² and ab.
Exam angle: counting questions are common. One-hot of k categories gives k columns (k − 1 if you drop one), and pairwise interactions of n features give n(n − 1)/2.
Selection methods
Feature selection keeps a subset of the original features to cut noise, training time and overfitting. It is different from feature extraction, such as PCA, which builds new features as combinations of the old ones (see Unsupervised Learning). Following the standard taxonomy of Guyon and Elisseeff, selection methods fall into three families.
| Family | How it works | Examples | Cost |
|---|---|---|---|
| Filter | Scores each feature with a statistic, without training the final model | Variance threshold, Pearson correlation, chi-square, mutual information, ANOVA F-test | Cheap |
| Wrapper | Trains the model on candidate subsets and keeps the best | Forward selection, backward elimination, recursive feature elimination (RFE) | Expensive |
| Embedded | Selection happens while the model trains | Lasso (L1), tree-based importance | Moderate |
Wrapper cost grows fast. Forward selection of 3 features out of 10 trains 10 + 9 + 8 = 27 models, while an exhaustive search tries 2¹⁰ − 1 = 1,023 subsets.
Two details catch students out. Pearson correlation only sees linear association, so a feature with r = 0 can still matter; mutual information catches non-linear dependence. And L1 regularisation can set coefficients exactly to zero, while L2 only shrinks them, so only Lasso performs selection.
Exam angle: you will be asked to classify a named method into one of the three families. Look for "retrains the model" (wrapper) versus "during training" (embedded).
Leakage
Data leakage happens when training data contains information that would not be available at prediction time. Evaluation scores look excellent, and then the model fails in production. There are two main kinds:
- Target leakage: a feature recorded after, or because of, the outcome. Example: "took_antibiotics" when predicting pneumonia at admission.
- Train–test contamination: a fitted step (scaler, imputer, feature selector, target encoder) sees test rows. Fit every such step on the training split only, ideally inside a scikit-learn
Pipelineso cross-validation refits it per fold.
Time series add a third risk: a random shuffle lets the model train on the future. Use a time-based split instead.
Exam angle: a near-perfect validation score driven by one feature is the classic leakage signal in analysis questions.
Common traps
- Treating a negative correlation as weak. A filter ranks by |r|, so −0.79 beats 0.40.
- Calling RFE or forward selection "filter" methods. Both retrain a model, so they are wrappers.
- Assuming zero Pearson correlation means independence. y = x² on symmetric x gives r = 0.
- Fitting the scaler or feature selector before the train/test split.
- Trusting impurity-based importance for ID-like columns. It favours high-cardinality features.
- Label-encoding a nominal feature (Karachi = 1, Lahore = 2) for a linear or distance-based model.
Worked examples
1. Understanding. Backward elimination starts with all features and removes the weakest one at a time, retraining the model at each step. Which family is it? Answer: wrapper. It uses the model's own performance to judge subsets, which is the defining feature of a wrapper.
2. Application. You expand features a and b to degree 2 and include the constant term. How many columns do you get? Answer: 6, namely 1, a, b, a², b² and ab. Using C(n + d, d) = C(4, 2) = 6 gives the same count.
3. Analysis. A churn model scores 98% on validation. Its top feature is account_closed_date, which is blank for active customers. What is wrong? Answer: target leakage. The closure date exists only because the customer has already churned, so a blank simply encodes "not churned". Drop the feature and re-evaluate; the honest score will be lower but will reflect production.
Practise
The quiz below has 100 questions on feature engineering and selection, filterable by tier and difficulty.
Practise: 100 questions
FAQs
Is feature selection the same as dimensionality reduction?
Selection is one form of dimensionality reduction, but not the only one. Selection keeps a subset of the original columns, so they stay interpretable. Extraction methods such as PCA create new axes that mix every original feature. Both reduce the number of inputs; exam questions usually test which one keeps the original features.
Should I scale features before or after the train/test split?
After. Split first, fit the scaler on the training set only, then use it to transform both training and test sets. Fitting on the full dataset leaks the test set's mean and spread into training. The same rule applies to imputers, encoders and feature selectors.
Is RFE a wrapper or an embedded method?
Most textbooks call recursive feature elimination a wrapper, because it retrains the model repeatedly and removes the weakest features each round. It uses the model's coefficients or importances to rank features, which is why some sources describe it as a hybrid. If an option says "wrapper", that is the standard answer.
Next step
Continue to Deep Learning Fundamentals MCQs, the next topic in the official order. Revisit the AI & ML MCQs hub to pick another topic, or test yourself in an NSCT mock test.