In today's lesson, we’ll examine an important preprocessing step for predictive modeling: normalizing features. Normalization adjusts the scale of feature data so that no single feature with a larger or smaller scale dominates the model. Our mission is to learn why normalization is necessary and to understand two primary methods of normalization, applying these techniques to the California Housing Dataset using Python.
Normalization addresses the issue of features having different ranges. Without scaling, features with larger value ranges could unfairly influence the results of our predictive model. In simple terms, if one feature has values ranging from 0 to 100 and another from 0 to 1, the first feature might dominate the model training process. As we work with features like house age and median income, normalizing helps ensure that each feature contributes to the model based on its importance, not merely its scale.
Standard scaling is a method that rescales the features so that they have a mean of zero and a standard deviation of one. This method calculates the z-score of each data point, which represents how many standard deviations a data point is from the mean. Let's apply standard scaling using Python:
