Moved preproccesing before the training/test/valid split