updated test_train_split function to be generalized function