简体   繁体   中英

how to convert xgboost dump text to xgboost model?

I have a text dump like below 1000 trees and I want to reconstruct the xgboost model from the dump and test new file on reconstructed model later.

booster[0]:
0:[sincelastrun<23.2917] yes=1,no=2,missing=2
   1:[sincelastrun<18.0417] yes=3,no=4,missing=4
       3:leaf=-0.0965415
       4:leaf=-0.0679503
   2:[sincelastrun<695.025] yes=5,no=6,missing=6
       5:leaf=-0.0992546
       6:leaf=-0.0984374
.
.
.
booster[1000]:

Thanks for the help.

You instantiate a booster from a file path like:

bst = xgb.Booster(model_file='<FILEPATH>')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM