Update doc for feature constraints and n_gpus. (#4596)
* Update doc for feature constraints. * Fix some warnings. * Clean up doc for `n_gpus`.
This commit is contained in:
@@ -101,24 +101,25 @@ def _run_with_rabit(rabit_args, func, *args):
|
||||
|
||||
|
||||
def run(client, func, *args):
|
||||
"""
|
||||
Launch arbitrary function on dask workers. Workers are connected by rabit, allowing
|
||||
distributed training. The environment variable OMP_NUM_THREADS is defined on each worker
|
||||
according to dask - this means that calls to xgb.train() will use the threads allocated by
|
||||
dask by default, unless the user overrides the nthread parameter.
|
||||
"""Launch arbitrary function on dask workers. Workers are connected by rabit,
|
||||
allowing distributed training. The environment variable OMP_NUM_THREADS is
|
||||
defined on each worker according to dask - this means that calls to
|
||||
xgb.train() will use the threads allocated by dask by default, unless the
|
||||
user overrides the nthread parameter.
|
||||
|
||||
Note: Windows platforms are not officially supported. Contributions are welcome here.
|
||||
Note: Windows platforms are not officially
|
||||
supported. Contributions are welcome here.
|
||||
|
||||
:param client: Dask client representing the cluster
|
||||
:param func: Python function to be executed by each worker. Typically contains xgboost
|
||||
training code.
|
||||
:param func: Python function to be executed by each worker. Typically
|
||||
contains xgboost training code.
|
||||
:param args: Arguments to be forwarded to func
|
||||
:return: Dict containing the function return value for each worker
|
||||
|
||||
"""
|
||||
if platform.system() == 'Windows':
|
||||
logging.warning(
|
||||
'Windows is not officially supported for dask/xgboost integration. Contributions '
|
||||
'welcome.')
|
||||
logging.warning('Windows is not officially supported for dask/xgboost'
|
||||
'integration. Contributions welcome.')
|
||||
workers = list(client.scheduler_info()['workers'].keys())
|
||||
env = client.run(_start_tracker, len(workers), workers=[workers[0]])
|
||||
rabit_args = [('%s=%s' % item).encode() for item in env[workers[0]].items()]
|
||||
|
||||
@@ -184,18 +184,16 @@ def to_graphviz(booster, fmap='', num_trees=0, rankdir='UT',
|
||||
no_color : str, default '#FF0000'
|
||||
Edge color when doesn't meet the node condition.
|
||||
condition_node_params : dict (optional)
|
||||
condition node configuration,
|
||||
{'shape':'box',
|
||||
'style':'filled,rounded',
|
||||
'fillcolor':'#78bceb'
|
||||
}
|
||||
condition node configuration,
|
||||
{'shape':'box',
|
||||
'style':'filled,rounded',
|
||||
'fillcolor':'#78bceb'}
|
||||
|
||||
leaf_node_params : dict (optional)
|
||||
leaf node configuration
|
||||
{'shape':'box',
|
||||
'style':'filled',
|
||||
'fillcolor':'#e48038'
|
||||
}
|
||||
'style':'filled',
|
||||
'fillcolor':'#e48038'}
|
||||
|
||||
kwargs :
|
||||
Other keywords passed to graphviz graph_attr
|
||||
|
||||
@@ -105,8 +105,8 @@ class XGBModel(XGBModelBase):
|
||||
Value in the data which needs to be present as a missing value. If
|
||||
None, defaults to np.nan.
|
||||
importance_type: string, default "gain"
|
||||
The feature importance type for the feature_importances_ property: either "gain",
|
||||
"weight", "cover", "total_gain" or "total_cover".
|
||||
The feature importance type for the feature_importances\\_ property:
|
||||
either "gain", "weight", "cover", "total_gain" or "total_cover".
|
||||
\\*\\*kwargs : dict, optional
|
||||
Keyword arguments for XGBoost Booster object. Full documentation of parameters can
|
||||
be found here: https://github.com/dmlc/xgboost/blob/master/doc/parameter.rst.
|
||||
|
||||
Reference in New Issue
Block a user