write file, record train&test set