script for preparing training set