0
$\begingroup$

Would it be ok to standardize all the features that exhibit normal distribution (with StandardScaler) and then re-scale all the features in the range 0-1 (with MinMaxScaler). So far I've only seen people doing one OR the other, but not in combination. Why is that?

Also, is the Shapiro Wilk Test a good way to test if standardization is advisable? Should all features exhibit a normal distribution or are you allowed to transform only the ones that do have it?

$\endgroup$

2 Answers 2

2
$\begingroup$

Doing both on a given feature is redundant, and equivalent to doing whichever you do last; they are both linear transformations.

StandardScaler doesn't require normally distributed data to be useful. It just centers and scales each feature so that it has mean zero and standard deviation 1; that's potentially useful no matter the distribution. See this stats.SE answer.

As to which is better, I don't know that there's a right answer. One of the sklearn core devs answered here, but it leaves a lot open.

$\endgroup$
1
$\begingroup$

Once you standardize the data, the data falls in the range -3.14 to +3.14 in 99.99% of the cases(6 Sigma). The main reason for standardizing the data is achieved as the data falls in a short range and the algorithm can converge faster. Applying normalization on top of it would further scale down the data to -1 to +1. So, in regular practise one of them is applied based on the scenario. As in the real data, data will be having outliers and the distributon might not be Gaussian, there are other scaling techniques(Robust Scaler can efficiently deal even we have outliers in the data. Quantile transformer Scaler also handles when there are outliers which under the hood uses a CDF to transform the data using that function.)

$\endgroup$

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.