I saved the model right after I trained it, and set the version to some arbitrary non-zero integer, however, after I reload the model from hard disk, the version number become zero. Is this a known bug and how do I get around it ? What I’m trying to achieve is to make sure the model that I loaded from hard drive is indeed the one that I want/need. Thanks.
Are you using JSON format?
I’m not sur what you mean. Here is what I did.
Booster booster = XGBoost.train();
booster booster2 = XGBoost.loadModel(“modelV1.bin”);
int versionNum = booster2.getVersion();
versionNum == 0
this is in Java by the way, you can easily replicate this issue.
The version is always zero when the model gets loaded from the disk, since the version number indicates the progress in the boosting algorithm. You should not need to use
setVersion, since it’s an internal method meant to be used internally by the boosting implementation.