Update to process training and test data separately