Wrapper to save the training data to different file formats
Write data to different file formats depending on the open_file and write_file functions