NCA-ADS - Data Manipulation and Preparation (23% of the exam) - Section 1.4
Apply feature engineering.
Create informative input features through encoding, scaling, binning, and interaction terms to improve model predictive power. Recognise which transformations are appropriate for categorical versus continuous variables in an accelerated pipeline.
Practice question for this objective
lock_openFree sampleData Manipulation and Preparationmedium
A team trains a cuML linear regression to predict crop yield from 'rainfall' and 'fertiliser'. Domain knowledge suggests that fertiliser helps far more when rainfall is high, so the effect of one variable depends on the level of the other. The current model uses only the two raw columns and underfits this combined effect. Which feature-engineering step lets the linear model represent this dependency?
AStandardise both columns to zero mean and unit variance so that their fitted coefficients become directly comparable in magnitude.
BAdd an interaction feature equal to the product of rainfall and fertiliser so that the model can fit how their combined level affects yield.check_circle Correct
CApply a logarithmic transformation to both columns so that the relationship between each feature and yield becomes linear.
DOne-hot encode rainfall and fertiliser into high and low bands so that each band combination receives its own indicator column.
Create an interaction feature by multiplying two columns so a linear model can capture effects that depend on both features jointly. A linear model sums independent per-feature effects and cannot represent dependencies between features. Multiplying two columns adds an interaction term whose coefficient lets the marginal effect of one feature vary with the level of the other.
Why A is wrong: Standardisation makes coefficients comparable and can help convergence, but it only rescales each feature independently and cannot let the model represent how one feature's effect changes with the other.
Why B is correct: Multiplying the two columns creates an interaction term whose coefficient lets the linear model capture the joint effect, so the marginal impact of fertiliser can scale with the level of rainfall rather than staying constant.
Why C is wrong: A log transform can linearise a curved single-feature relationship, but it acts on each column separately and still cannot express that fertiliser's effect depends on the rainfall level.
Why D is wrong: Binning then one-hot encoding can approximate an interaction, but it coarsens both continuous features into a few buckets and loses magnitude information, making it a cruder solution than a direct product term.
Answers that look right on this material and are not. Each one is a distractor from a different question in the NCA-ADS bank for this domain.
Standardise both 'loan_amount' and 'interest_rate' so their means are zero and their variances are one, which lets the linear model weight their combined contribution correctly.
errorWhy it is wrong: Standardisation puts the two features on a common scale and stabilises coefficient estimates, which makes it tempting, but a linear model fitted only on scaled additive terms still treats the features independently and cannot represent a multiplicative joint effect.
Apply one-hot encoding via cuDF to expand the column into a binary indicator matrix
errorWhy it is wrong: One-hot encoding is intuitive for categoricals, but with 2,000 unique values it produces 2,000 new columns, causing severe memory overhead on GPU memory and a very sparse matrix that hurts gradient-boosted tree performance.
The multiplication operation introduces floating-point rounding errors that accumulate beyond the original column bounds
errorWhy it is wrong: Floating-point rounding in GPU arithmetic is a real concern for precision-sensitive work, but rounding errors are tiny relative to the column magnitudes and cannot cause a systematic range expansion to values far above either original column's maximum.