Standardization, Oversampling and Evaluation Please help me to understand which of the following is correct and why.


X_train, X_test : Split the training set into training and test sets
X_train_std : Standardize X_train
X_train_res : Oversample X_train_std
model.fit : Train the model using X_train_res
X_test_std : Standardize X_test using the parameters calculated in 2)
model.evaluate : Evaluate the model using X_test_std


Or:


X_train, X_test : Split the training set into training and test sets
X_train_std : Standardize X_train
X_train_res : Oversample X_train_std
X_train_res_std : Standardize X_train_res
model.fit : Train the model using X_train_res_std
X_test_std : Standardize X_test using the parameters calculated in 4)
model.evaluate : Evaluate the model using X_test_std
Let's discuss the second variant: 

If a standardization is considered as a function f(data) and the second standardization after oversampling is considered as a function g(f(data)), then you should use the same transformation for your test data. However, in the second option you just implement the function g(data) without transformation the data using function f(). 

Therefor, it seems to me, that the first variant is better. Moreover, it is enough to standardize data just once, so the first option is ok.