how to convert xgboost dump text to xgboost model?

  python, xgboost

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.

Source: Python Questions

LEAVE A COMMENT