My first approach was to split the data-set into training and test set. Thereafter, I preprocessed the training set (normalizing and imputing the missing values) and used cross-validation to tune the parameters (hyperopt) on already preprocessed training set.

However, now this approach seems naive to me because cross-validation would use a preprocessed training set and thus inviting some data leakage to the cross-validation.

Now I am thinking that I should instead split the data-set and do the pre-processing and tuning wihtin each fold in cross-validation. However, I am unsure on how to pre-process the original test set.

My question is if the second approach is correct and if so how do I preprocess the test set.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.