比较好的完整示例:
https://blog.csdn.net/u010159842/article/details/78053669
X = train.drop(['标签', '用户标识'], axis=1)
xgb_train = xgb.DMatrix(X, label=y)
tar = xgb.Booster(model_file='20170201_B.model')
preds = tar.predict(xgb_train)
np.savetxt('submission_xgb_MultiSoftmax.csv',np.c_[range(1,len(X)+1),preds],
delimiter=',',header='ImageId,Label',comments='',fmt='%d')