Session Ready
Exercise

Normalize the variables

Now, for the last step in data preparation. You will transform the unskewed dataset wholesale_boxcox to the same scale, meaning all columns have a mean of zero, and standard deviation of 1. You will use the StandardScaler function from the sklearn.preprocessing module.

The unskewed wholesale_coxbox dataset you have transformed in the previous exercise has been imported as a pandas DataFrame. Also, the StandardScaler() instance has been initialized as scaler.

Instructions
100 XP
  • Fit the initialized scaler instance on the Box-Cox transformed dataset.
  • Transform and store the scaled dataset as wholesale_scaled.
  • Create a pandas DataFrame from the scaled dataset.
  • Print the mean and standard deviation for all columns.