Added function for loading training sets.