How it works...
In this recipe, we standardized the numerical variables of the Boston House Prices dataset from scikit-learn. To implement mean normalization, we learned and stored the mean, maximum, and minimum values from the variables in the train set, which we used to normalize the train and test sets.
We loaded the dataset and divided it into train and test sets using the train_test_split() function from scikit-learn. More details on this operation can be found in the Standardizing the features recipe of this chapter. To implement mean normalization, we captured the mean values of the numerical variables in the train set using the pandas mean() method. Next, we determined the difference between the maximum and minimum values of the numerical ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access