Skip to content

Commit 4f18c88

Browse files
authored
Move DART state into GBTree (#12078)
1 parent 964dc1d commit 4f18c88

5 files changed

Lines changed: 212 additions & 201 deletions

File tree

doc/parameter.rst

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ General Parameters
5555
* ``booster`` [default= ``gbtree``]
5656

5757
- Which booster to use. Can be ``gbtree``, ``gblinear`` or ``dart``; ``gbtree`` and ``dart`` use tree based models while ``gblinear`` uses linear functions.
58+
- Dropout parameters like ``rate_drop`` can be used directly with tree models. ``booster=dart`` remains supported for compatibility.
5859

5960
.. deprecated:: 3.3.0
6061

@@ -304,19 +305,8 @@ These parameters are only used for training with categorical data. See
304305
- Maximum number of categories considered for each split. Used only by partition-based
305306
splits for preventing over-fitting.
306307

307-
Additional parameters for Dart Booster (``booster=dart``)
308-
=========================================================
309-
310-
.. note:: Using ``predict()`` with DART booster
311-
312-
If the booster object is DART type, ``predict()`` will perform dropouts, i.e. only
313-
some of the trees will be evaluated. This will produce incorrect results if ``data`` is
314-
not the training data. To obtain correct results on test sets, set ``iteration_range`` to
315-
a nonzero value, e.g.
316-
317-
.. code-block:: python
318-
319-
preds = bst.predict(dtest, iteration_range=(0, num_round))
308+
Additional dropout parameters for tree boosters
309+
================================================
320310

321311
* ``sample_type`` [default= ``uniform``]
322312

doc/tutorials/dart.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
############
2-
DART booster
3-
############
1+
####
2+
DART
3+
####
44
XGBoost mostly combines a huge number of regression trees with a small learning rate.
55
In this situation, trees added early are significant and trees added late are unimportant.
66

77
Vinayak and Gilad-Bachrach proposed a new method to add dropout techniques from the deep neural net community to boosted trees, and reported better results in some situations.
88

9-
This is a instruction of new tree booster ``dart``.
9+
This is a instruction of the dropout mode for tree models. Dropout is controlled by
10+
parameters like ``rate_drop``. The legacy ``dart`` booster name remains available for
11+
compatibility.
1012

1113
**************
1214
Original paper
@@ -48,7 +50,8 @@ How it works
4850
Parameters
4951
**********
5052

51-
The booster ``dart`` inherits ``gbtree`` booster, so it supports all parameters that ``gbtree`` does, such as ``eta``, ``gamma``, ``max_depth`` etc.
53+
Dropout uses the same tree parameters as ``gbtree``, such as ``eta``, ``gamma``,
54+
``max_depth``, and others.
5255

5356
Additional parameters are noted below:
5457

@@ -99,8 +102,7 @@ Sample Script
99102
dtrain = xgb.DMatrix('demo/data/agaricus.txt.train?format=libsvm')
100103
dtest = xgb.DMatrix('demo/data/agaricus.txt.test?format=libsvm')
101104
# specify parameters via map
102-
param = {'booster': 'dart',
103-
'max_depth': 5, 'learning_rate': 0.1,
105+
param = {'max_depth': 5, 'learning_rate': 0.1,
104106
'objective': 'binary:logistic',
105107
'sample_type': 'uniform',
106108
'normalize_type': 'tree',

0 commit comments

Comments
 (0)