Better doc for save_model() / load_model() (#3143)

Be clear that they do not save Python-specific attributes
This commit is contained in:
cinqS 2018-06-29 12:24:33 +08:00 committed by Philip Hyunsu Cho
parent 12e34f32e2
commit 8bec8d5e9a

View File

@ -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