6
$\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$
11
$\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
7
$\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, privacy policy and cookie policy

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