I am working on a regression problem. The data contains 13 features (after performing feature selection). to some of these features, I have applied log transformation and box-cox to fix the skewness. For some features, I have also used standard scaling.

So my question is that should I also apply these transformations to the test data as well. As the model is trained on the transformed features, it makes sense to apply these transformations to test data as well.

If the answer is yes, then how should I apply the transformation?

for instance on train data the code looks something like this

    scaler = StandardScaler()

should I use the same StandardScaler object for test data as well or I am allowed to create a new instance of the StandardScaler object and use that for transformation?


1 Answer 1


You need to apply the same transformations to the test data and use the fitted values/object on training data to transform the test data.


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.