add pred_train function