How to save & load xgboost model?

后端 未结 5 450
南方客
南方客 2020-12-04 18:00

On the link of XGBoost guide:

After training, the model can be saved.

bst.save_model(\'0001.model\')

The model a

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 18:23

    Both functions save_model and dump_model save the model, the difference is that in dump_model you can save feature name and save tree in text format.

    The load_model will work with model from save_model. The model from dump_model can be used for example with xgbfi.

    During loading the model, you need to specify the path where your models is saved. In the example bst.load_model("model.bin") model is loaded from file model.bin - it is just a name of file with model. Good luck!

提交回复
热议问题