I have a feature vector with One-Hot-Encoded features and with continous features.

How can I decide now, which data I shall scale with StandardScaler and which data scale with MinMaxScaler? I think I do not have to scale the one-hot-encoded anyway because they are already between 0 and 1.

(I use afterwards a MLPClassifier)

  • 4
    $\begingroup$ Rule of thumb: Use StandardScaler for normally distributed data, otherwise use MinMaxScaler. $\endgroup$ Commented Jan 14, 2019 at 16:06

3 Answers 3


StandardScaler and MinMaxScaler are more common when dealing with continuous numerical data.

One possible preprocessing approach for OneHotEncoding scaling is "soft-binarizing" the dummy variables by converting softb(0) = 0.1, softb(1) = 0.9. From my experience with feedforward Neural Networks this was found to be quite useful, so I expect it to be also benefitial for your MLPClassifier.

StandardScaler is useful for the features that follow a Normal distribution. This is clearly illustrated in the image below (source).

enter image description here

MinMaxScaler may be used when the upper and lower boundaries are well known from domain knowledge (e.g. pixel intensities that go from 0 to 255 in the RGB color range).


In "Python Machine Learning" by Raschka the author provides some guidance on page 111 when to normalize (min-max scale) and when to standardize data:

Although normalization via min-max scaling is a commonly used technique that is useful when we need values in a bounded interval, standardization can be more practical for many machine learning algorithms. The reason is that many linear models, such as the logistic regression and SVM, [...] initialize the weights to 0 or small random values close to 0. Using standardization, we center the feature columns at mean 0 with standard deviation 1 so that the feature columns take the form of a normal distribution, which makes it easier to learn the weights. Furthermore, standardization maintains useful information about outliers and makes the algorithm less sensitive to them in contrast to min-max scaling, which scales the data to a limited range of values.


StandardSCalar changes the shape of data while keeping data into range of 0 and 1. It can eliminate the outliers(which sometimes provides some useful info). NOTE: Do not remove all outliers until you do not have domain knowledge sbout them.

MinMaxScalar() do not changes the shape of data, while it also keeps the data into range of 0 and 1. It will do it for minimum number of features required.


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.