From 8bec8d5e9a7b56678634178f61f583683e26c57c Mon Sep 17 00:00:00 2001 From: cinqS Date: Fri, 29 Jun 2018 12:24:33 +0800 Subject: [PATCH] Better doc for save_model() / load_model() (#3143) Be clear that they do not save Python-specific attributes --- python-package/xgboost/core.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index 7f1ad1727..47e05b614 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -1175,6 +1175,11 @@ class Booster(object): """ Save the model to a file. + The model is saved in an XGBoost internal binary format which is + universal among the various XGBoost interfaces. Auxiliary attributes of + the Python Booster object (such as feature_names) will not be saved. + To preserve all attributes, pickle the Booster object. + Parameters ---------- fname : string @@ -1204,6 +1209,11 @@ class Booster(object): """ Load the model from a file. + The model is loaded from an XGBoost internal binary format which is + universal among the various XGBoost interfaces. Auxiliary attributes of + the Python Booster object (such as feature_names) will not be loaded. + To preserve all attributes, pickle the Booster object. + Parameters ---------- fname : string or a memory buffer