7
$\begingroup$

I have been using the StandardScaler function from the sklearn library. Could you tell me how it normalizes the distribution in order to convert it into a Gaussian distribution?

$\endgroup$

2 Answers 2

13
$\begingroup$

The StandardScaler function from the sklearn library actually does not convert a distribution into a Gaussian or Normal distribution. It is used when there are large variations among the distribution values. It simply is a Feature Scaling method used to standardize the distribution making the values lie in the same range.

It subtracts the mean of the distribution from each of its values which is then divided by the standard deviation, thus giving a distribution with mean = 0 and standard deviation = 1, which is not necessarily a normal distribution. It remains non-Gaussian.

Similarly, MinMaxScaler is another function that scales and transforms features which can be made to lie in a given range, e.g., (0, 1) which is the default range.

$\endgroup$
0
8
$\begingroup$

Not limited to scikit-learn, standardization does not convert features/variables into a normal distribution. It just subtracts the mean and divides by the standard deviation. The resulting feature will have a mean $0$ and a variance $1$. This has nothing to do with normal distribution.

In essence, the following affine transform doesn't convert random variables into normal RV: $$Z=\frac{X-\mu}{\sigma}$$

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.