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() scaler.fit(np.reshape(train_data["cont1"]) scaler.transform(train_data["cont1"])
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?