I have a dataset with both numerical and categorical features (variables), I converted all the categorical variables in dummies, then I split the train and test data.

Now I am at the step where I want to standardize the features before fitting the model.

  1. Should I apply the standardisation to all the features or only to the numerical ones?

  2. In this case, is it preferable to use the MinMax scaler on a range 0 to 1?


1 Answer 1


1) Dummy variables doesn't need to be standardized, just numerical ones, but if you use MaxMin scaler you can pass both numerical and dummy variables because this scaler doesn't change the values of dummy variables, try to apply the equation to dummy variables to see.

$$ z_i=\frac{x_i-\min(x)}{\max(x)-\min(x)} $$

2) That's a trick question and the response is: it depends. If you have some outlier in your data MaxMin doesn't fit well, because this outlier will be replaced by 0 or 1 and the rest of data will be confined in a very restricted range of values, in this case you should use a normal scaler.

  • $\begingroup$ Thanks, so if I apply the scaler to all the dataset (including dummies) to save the time of separating the columns in the dataframe, will be the resulting data biased? $\endgroup$ Commented Apr 16, 2018 at 19:34
  • $\begingroup$ It can bias your learner and the fact you have your core data confined in a small range diffcults the learner to learn. $\endgroup$
    – romulomadu
    Commented Apr 17, 2018 at 16:38

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.