What do you understand by 'feature scaling', and why is it important?

Instruction: Define feature scaling and its importance in the context of training deep learning models.

Context: This question seeks to examine the candidate's understanding of feature scaling and its impact on model performance and training efficiency.

Updated

Example Answer

Feature scaling puts numeric inputs on useful, comparable scales. For standardization, I subtract the training-set mean and divide by the training-set standard deviation. The training feature then has mean zero and unit variance when its variance is nonzero. This does not make a skewed or bimodal distribution Gaussian.

Scaling matters for distance-based models, regularized linear models, and many neural-network optimization problems. A feature measured in thousands should not dominate just because another is measured in fractions. I fit the scaler on training data only, then reuse those statistics on validation, test, and production inputs. Refitting on the test set would leak information and change the input representation.

I would inspect outliers before choosing a scaler. Standardization is sensitive to them; a robust scaler may be more appropriate. Constant features also need explicit handling rather than division by zero.

Worked Example

For training values [1, 1, 1, 9], the mean is 3 and the population standard deviation is √12. Their standardized values are approximately [-0.577, -0.577, -0.577, 1.732]: centered and scaled, but still strongly asymmetric.

scikit-learn StandardScaler

Related Questions