Skip to main content
deleted 2 characters in body
Source Link

In short:

  • Scaling is indeed desired.
  • Standardizing and normalizing should both be fine. And reasonable scaling should be good.
  • Of course you do need to scale your test set, but you do not "train" (i.e. fit) your scaler on the test data - you scale them using a scaler fitted on the train data (it's very natural to do in SKLearn).
    • For example, if you're normalizing your data (like with an SKLearn StandardScaler object), you .trainfit it on the train data to get the mean and standard deviance from it, and you .transform both train and test data to subtract the train mean and divide by the standard deviance.

In short:

  • Scaling is indeed desired.
  • Standardizing and normalizing should both be fine. And reasonable scaling should be good.
  • Of course you do need to scale your test set, but you do not "train" (i.e. fit) your scaler on the test data - you scale them using a scaler fitted on the train data (it's very natural to do in SKLearn).
    • For example, if you're normalizing your data (like with an SKLearn StandardScaler object), you .train it on the train data to get the mean and standard deviance from it, and you .transform both train and test data to subtract the train mean and divide by the standard deviance.

In short:

  • Scaling is indeed desired.
  • Standardizing and normalizing should both be fine. And reasonable scaling should be good.
  • Of course you do need to scale your test set, but you do not "train" (i.e. fit) your scaler on the test data - you scale them using a scaler fitted on the train data (it's very natural to do in SKLearn).
    • For example, if you're normalizing your data (like with an SKLearn StandardScaler object), you .fit it on the train data to get the mean and standard deviance from it, and you .transform both train and test data to subtract the train mean and divide by the standard deviance.
Source Link

In short:

  • Scaling is indeed desired.
  • Standardizing and normalizing should both be fine. And reasonable scaling should be good.
  • Of course you do need to scale your test set, but you do not "train" (i.e. fit) your scaler on the test data - you scale them using a scaler fitted on the train data (it's very natural to do in SKLearn).
    • For example, if you're normalizing your data (like with an SKLearn StandardScaler object), you .train it on the train data to get the mean and standard deviance from it, and you .transform both train and test data to subtract the train mean and divide by the standard deviance.