⭐ Star
0%
MODULE 03 ⏱️ 15-22 MIN READ

Feature Engineering, Imputation & Transformations

Preprocess raw tabular data with robust scaling, Box-Cox normality transformations, and MICE missing data imputation.

1. Feature Scaling: StandardScaler vs MinMaxScaler

Distance-based algorithms (SVM, KNN, PCA, Gradient Descent) require feature normalization to prevent large-magnitude columns from dominating the gradient update:

\[ z = \frac{x - \mu}{\sigma} \quad \text{(StandardScaler)}, \qquad x_{\text{scaled}} = \frac{x - x_{\min}}{x_{\max} - x_{\min}} \quad \text{(MinMaxScaler)} \]

2. Box-Cox Power Transformations

Stabilizes non-constant variance and maps skewed distributions into approximate Gaussian normality:

\[ y^{(\lambda)} = \begin{cases} \frac{y^\lambda - 1}{\lambda} & \text{if } \lambda \ne 0 \\ \ln(y) & \text{if } \lambda = 0 \end{cases} \]

🎯 Module Mastery Certification Quiz

+100 XP
When should you use StandardScaler over MinMaxScaler?
When the feature contains outliers and you want zero mean and unit variance without bounding the data to [0, 1].
Only when working with image pixels.
StandardScaler should never be used.
Only when feature values are negative.