In mean normalization, we center the variable at zero and rescale the distribution to the value range. This procedure involves subtracting the mean from each observation and then dividing the result by the difference between the minimum and maximum values:
This transformation results in a distribution centered at 0, with its minimum and maximum values within the range of -1 to 1. In this recipe, we will implement mean normalization with pandas and then with scikit-learn.