Xgboost 模型保存和载入()

https://blog.csdn.net/u012884015/article/details/78653178

xgb_model.get_booster().save_model('xgb.model')
tar = xgb.Booster(model_file='xgb.model')
x_test = xgb.DMatrix(x_test)
pre=tar.predict(x_test)
act=y_test
print(mean_squared_error(act, pre))

  

posted @ 2018-08-14 20:48  静悟生慧  阅读(13808)  评论(0编辑  收藏  举报