data preparation for training