Your features include age (years), income (TRY) and num_logins (count), on very different scales. For which group of models is feature scaling generally required to get sensible results?
Show the answer and explanation
Correct answer: B, KNN, SVM with an RBF kernel, PCA, k-means and L1/L2-regularized linear models, because distances, variances or penalties treat all the features as if they shared one scale.
Explanation Feature Scaling
Scaling matters whenever an algorithm compares features on a common scale:
| Model | Needs scaling? | Why |
|---|---|---|
| KNN, k-means, SVM (RBF) | yes | Euclidean distances are dominated by large-scale features |
| PCA | yes | it maximises variance, so large-unit features dominate the components |
| Ridge, Lasso, Elastic Net, regularized logistic regression | yes | the penalty on β depends on the units of x |
| Neural networks, SGD-based models | strongly recommended | gradient descent converges much faster on similar scales |
| Plain OLS | not for predictions | coefficients simply rescale; scaling only aids interpretation and numerics |
| Decision trees, random forest, gradient boosting | no | each split thresholds one feature; only the order matters |
| Gaussian Naive Bayes | no | each feature gets its own mean and variance |
Why the distractors fail: tree splits are evaluated within each feature ("income < 52,000?") and compared by impurity reduction, which does not depend on units. Gaussian Naive Bayes and plain OLS give the same predictions with or without scaling. Gradient descent is not the only scale-sensitive method: distances, variance maximisation and penalties are too.
In practice, put the scaler inside a scikit-learn Pipeline (or a ColumnTransformer for the numeric columns), so it is fitted on training folds only and applied identically at inference.
Interview tip: the crisp version is "distances, variances, penalties and gradients care about scale; trees do not". Mention that one-hot columns are usually left unscaled.