Preprocessing function for raw data: aimed to replace scaling and train_test_split