Added support for saving TrainingSample objects in files