user3103059
user3103059

Reputation:

How do you load a XGBoost model saved using dump_model?

Seems that there is no answer to this question. Yet in the documentation is is listed as a possible way to save the model.

dump_model(fout, fmap='', with_stats=False, dump_format='text')

After hours of searching I have found no answer of how to recover my model. And training it again is a not an option. It took more than 10 days of training.

So if anybody can give me an answer (that does not include training the model again) I will kindly appreciate. The model is already saved using dump_model. So please focus on that.

When I try to use get_dump() I receive a cryptic message

> xgboost.core.XGBoostError: [05:27:16]
> C:\Users\Administrator\workspace\xgboost-win64_release_1.1.0\src\learner.cc:506:
> Check failed: mparam_.num_feature != 0 (0 vs. 0) : 0 feature is
> supplied.  Are you using raw Booster interface?

Upvotes: 1

Views: 1710

Answers (1)

user3103059
user3103059

Reputation:

Not possible without hand written parser according to this Github answer. It's for visualization like plotting the trees, exporting to other formats for other libraries etc. But not for saving a working model.

This caveat is not included in the documentation for some obscure reason.

Bummer.

Upvotes: 2

Related Questions