Serialise booster after training to reset state (#5484)

* Serialise booster after training to reset state

* Prevent process_type being set on load

* Check for correct updater sequence
This commit is contained in:
Rory Mitchell
2020-04-11 16:27:12 +12:00
committed by GitHub
parent 4a0c8ef237
commit 093e2227e3
5 changed files with 27 additions and 7 deletions

View File

@@ -109,7 +109,9 @@ def _train_internal(params, dtrain,
else:
bst.best_iteration = nboost - 1
bst.best_ntree_limit = (bst.best_iteration + 1) * num_parallel_tree
return bst
# Copy to serialise and unserialise booster to reset state and free training memory
return bst.copy()
def train(params, dtrain, num_boost_round=10, evals=(), obj=None, feval=None,