Update Python doc. [skip ci] (#5517)
* Update doc for copying booster. [skip ci] The issue is resolved in #5312 . * Add version for new APIs. [skip ci]
This commit is contained in:
parent
88b64c8162
commit
c90119eb67
@ -1048,6 +1048,9 @@ class DeviceQuantileDMatrix(DMatrix):
|
|||||||
quantisation.
|
quantisation.
|
||||||
|
|
||||||
You can construct DeviceQuantileDMatrix from cupy/cudf/dlpack.
|
You can construct DeviceQuantileDMatrix from cupy/cudf/dlpack.
|
||||||
|
|
||||||
|
.. versionadded:: 1.1.0
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, data, label=None, weight=None, base_margin=None,
|
def __init__(self, data, label=None, weight=None, base_margin=None,
|
||||||
@ -1197,7 +1200,10 @@ class Booster(object):
|
|||||||
|
|
||||||
def save_config(self):
|
def save_config(self):
|
||||||
'''Output internal parameter configuration of Booster as a JSON
|
'''Output internal parameter configuration of Booster as a JSON
|
||||||
string.'''
|
string.
|
||||||
|
|
||||||
|
.. versionadded:: 1.0.0
|
||||||
|
'''
|
||||||
json_string = ctypes.c_char_p()
|
json_string = ctypes.c_char_p()
|
||||||
length = c_bst_ulong()
|
length = c_bst_ulong()
|
||||||
_check_call(_LIB.XGBoosterSaveJsonConfig(
|
_check_call(_LIB.XGBoosterSaveJsonConfig(
|
||||||
@ -1208,7 +1214,10 @@ class Booster(object):
|
|||||||
return json_string
|
return json_string
|
||||||
|
|
||||||
def load_config(self, config):
|
def load_config(self, config):
|
||||||
'''Load configuration returned by `save_config`.'''
|
'''Load configuration returned by `save_config`.
|
||||||
|
|
||||||
|
.. versionadded:: 1.0.0
|
||||||
|
'''
|
||||||
assert isinstance(config, str)
|
assert isinstance(config, str)
|
||||||
_check_call(_LIB.XGBoosterLoadJsonConfig(
|
_check_call(_LIB.XGBoosterLoadJsonConfig(
|
||||||
self.handle,
|
self.handle,
|
||||||
@ -1218,11 +1227,7 @@ class Booster(object):
|
|||||||
return self.__deepcopy__(None)
|
return self.__deepcopy__(None)
|
||||||
|
|
||||||
def __deepcopy__(self, _):
|
def __deepcopy__(self, _):
|
||||||
'''Return a copy of booster. Caches for DMatrix are not copied so continue
|
'''Return a copy of booster.'''
|
||||||
training on copied booster will result in lower performance and
|
|
||||||
slightly different result.
|
|
||||||
|
|
||||||
'''
|
|
||||||
return Booster(model_file=self)
|
return Booster(model_file=self)
|
||||||
|
|
||||||
def copy(self):
|
def copy(self):
|
||||||
@ -1517,6 +1522,8 @@ class Booster(object):
|
|||||||
Whether the prediction value is used for training. This can effect
|
Whether the prediction value is used for training. This can effect
|
||||||
`dart` booster, which performs dropouts during training iterations.
|
`dart` booster, which performs dropouts during training iterations.
|
||||||
|
|
||||||
|
.. versionadded:: 1.0.0
|
||||||
|
|
||||||
.. note:: Using ``predict()`` with DART booster
|
.. note:: Using ``predict()`` with DART booster
|
||||||
|
|
||||||
If the booster object is DART type, ``predict()`` will not perform
|
If the booster object is DART type, ``predict()`` will not perform
|
||||||
@ -1601,6 +1608,8 @@ class Booster(object):
|
|||||||
booster.set_param({'predictor': 'cpu_predictor})
|
booster.set_param({'predictor': 'cpu_predictor})
|
||||||
booster.inplace_predict(numpy_array)
|
booster.inplace_predict(numpy_array)
|
||||||
|
|
||||||
|
.. versionadded:: 1.1.0
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
data : numpy.ndarray/scipy.sparse.csr_matrix/cupy.ndarray/
|
data : numpy.ndarray/scipy.sparse.csr_matrix/cupy.ndarray/
|
||||||
|
|||||||
@ -126,6 +126,8 @@ class DaskDMatrix:
|
|||||||
the input data explicitly if you want to see actual computation of
|
the input data explicitly if you want to see actual computation of
|
||||||
constructing `DaskDMatrix`.
|
constructing `DaskDMatrix`.
|
||||||
|
|
||||||
|
.. versionadded:: 1.0.0
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
client: dask.distributed.Client
|
client: dask.distributed.Client
|
||||||
@ -368,6 +370,8 @@ def _get_rabit_args(worker_map, client):
|
|||||||
def train(client, params, dtrain, *args, evals=(), **kwargs):
|
def train(client, params, dtrain, *args, evals=(), **kwargs):
|
||||||
'''Train XGBoost model.
|
'''Train XGBoost model.
|
||||||
|
|
||||||
|
.. versionadded:: 1.0.0
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
client: dask.distributed.Client
|
client: dask.distributed.Client
|
||||||
@ -459,6 +463,8 @@ def predict(client, model, data, *args, missing=numpy.nan):
|
|||||||
|
|
||||||
Only default prediction mode is supported right now.
|
Only default prediction mode is supported right now.
|
||||||
|
|
||||||
|
.. versionadded:: 1.0.0
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
client: dask.distributed.Client
|
client: dask.distributed.Client
|
||||||
@ -582,6 +588,8 @@ def inplace_predict(client, model, data,
|
|||||||
missing=numpy.nan):
|
missing=numpy.nan):
|
||||||
'''Inplace prediction.
|
'''Inplace prediction.
|
||||||
|
|
||||||
|
.. versionadded:: 1.1.0
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
client: dask.distributed.Client
|
client: dask.distributed.Client
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user