Skip to content

Commit 939bfe1

Browse files
committed
Rebuild dev docs at master=d9f3277
1 parent c878c17 commit 939bfe1

File tree

242 files changed

+1567
-1476
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

242 files changed

+1567
-1476
lines changed

dev/_downloads/plot_gradient_boosting_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
###############################################################################
3535
# Fit regression model
36-
params = {'n_estimators': 500, 'max_depth': 4, 'min_samples_split': 1,
36+
params = {'n_estimators': 500, 'max_depth': 4, 'min_samples_split': 2,
3737
'learning_rate': 0.01, 'loss': 'ls'}
3838
clf = ensemble.GradientBoostingRegressor(**params)
3939

1.16 KB
Loading
1.16 KB
Loading
2.11 KB
Loading
2.11 KB
Loading

dev/_sources/auto_examples/ensemble/plot_gradient_boosting_regression.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This example fits a Gradient Boosting model with least squares loss and
2020

2121
**Script output**::
2222

23-
MSE: 6.7710
23+
MSE: 6.5747
2424

2525

2626

@@ -29,6 +29,6 @@ This example fits a Gradient Boosting model with least squares loss and
2929
.. literalinclude:: plot_gradient_boosting_regression.py
3030
:lines: 11-
3131

32-
**Total running time of the example:** 1.16 seconds
33-
( 0 minutes 1.16 seconds)
32+
**Total running time of the example:** 1.13 seconds
33+
( 0 minutes 1.13 seconds)
3434

dev/_sources/modules/ensemble.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,20 +165,20 @@ in bias::
165165
>>> X, y = make_blobs(n_samples=10000, n_features=10, centers=100,
166166
... random_state=0)
167167

168-
>>> clf = DecisionTreeClassifier(max_depth=None, min_samples_split=1,
168+
>>> clf = DecisionTreeClassifier(max_depth=None, min_samples_split=2,
169169
... random_state=0)
170170
>>> scores = cross_val_score(clf, X, y)
171171
>>> scores.mean() # doctest: +ELLIPSIS
172172
0.97...
173173

174174
>>> clf = RandomForestClassifier(n_estimators=10, max_depth=None,
175-
... min_samples_split=1, random_state=0)
175+
... min_samples_split=2, random_state=0)
176176
>>> scores = cross_val_score(clf, X, y)
177177
>>> scores.mean() # doctest: +ELLIPSIS
178178
0.999...
179179

180180
>>> clf = ExtraTreesClassifier(n_estimators=10, max_depth=None,
181-
... min_samples_split=1, random_state=0)
181+
... min_samples_split=2, random_state=0)
182182
>>> scores = cross_val_score(clf, X, y)
183183
>>> scores.mean() > 0.999
184184
True

dev/_sources/modules/tree.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ Tips on practical use
343343
* Use ``min_samples_split`` or ``min_samples_leaf`` to control the number of
344344
samples at a leaf node. A very small number will usually mean the tree
345345
will overfit, whereas a large number will prevent the tree from learning
346-
the data. Try ``min_samples_leaf=5`` as an initial value.
346+
the data. Try ``min_samples_leaf=5`` as an initial value. If the sample size
347+
varies greatly, a float number can be used as percentage in these two parameters.
347348
The main difference between the two is that ``min_samples_leaf`` guarantees
348349
a minimum number of samples in a leaf, while ``min_samples_split`` can
349350
create arbitrary small leaves, though ``min_samples_split`` is more common

dev/_sources/whats_new.txt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ New features
2121
implementation supports kernel engineering, gradient-based hyperparameter optimization or
2222
sampling of functions from GP prior and GP posterior. Extensive documentation and
2323
examples are provided. By `Jan Hendrik Metzen`_.
24-
25-
- Added the :class:`ensemble.IsolationForest` class for anomaly detection based on
24+
25+
- Added the :class:`ensemble.IsolationForest` class for anomaly detection based on
2626
random forests. By `Nicolas Goix`_.
2727

2828
Enhancements
@@ -39,8 +39,18 @@ Enhancements
3939
method ``decision_path`` which returns the decision path of samples in
4040
the tree. By `Arnaud Joly`_
4141

42-
- A new example has been added unveling the decision tree structure.
43-
By `Arnaud Joly`_
42+
43+
- The random forest, extra tree and decision tree estimators now has a
44+
method ``decision_path`` which returns the decision path of samples in
45+
the tree. By `Arnaud Joly`_
46+
47+
- A new example has been added unveling the decision tree structure.
48+
By `Arnaud Joly`_
49+
50+
- Random forest, extra trees, decision trees and gradient boosting estimator
51+
accept the parameter ``min_samples_split`` and ``min_samples_leaf``
52+
provided as a percentage of the training samples. By
53+
`yelite`_ and `Arnaud Joly`_
4454

4555
Bug fixes
4656
.........
@@ -65,6 +75,10 @@ Bug fixes
6575
:class:`decomposition.KernelPCA`, :class:`manifold.LocallyLinearEmbedding`,
6676
and :class:`manifold.SpectralEmbedding`. By `Peter Fischer`_.
6777

78+
- Random forest, extra trees, decision trees and gradient boosting
79+
won't accept anymore ``min_samples_split=1`` as at least 2 samples
80+
are required to split a decision tree node. By `Arnaud Joly`_
81+
6882
API changes summary
6983
-------------------
7084

@@ -3854,3 +3868,4 @@ David Huard, Dave Morrill, Ed Schofield, Travis Oliphant, Pearu Peterson.
38543868
.. _Graham Clenaghan: https://github.com/gclenaghan
38553869
.. _Giorgio Patrini: https://github.com/giorgiop
38563870
.. _Elvis Dohmatob: https://github.com/dohmatob
3871+
.. _yelite https://github.com/yelite

dev/auto_examples/ensemble/plot_gradient_boosting_regression.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
500 regression trees of depth 4.</p>
173173
<img alt="../../_images/plot_gradient_boosting_regression_001.png" class="align-center" src="../../_images/plot_gradient_boosting_regression_001.png" />
174174
<p><strong>Script output</strong>:</p>
175-
<div class="highlight-python"><div class="highlight"><pre>MSE: 6.7710
175+
<div class="highlight-python"><div class="highlight"><pre>MSE: 6.5747
176176
</pre></div>
177177
</div>
178178
<p><strong>Python source code:</strong> <a class="reference download internal" href="../../_downloads/plot_gradient_boosting_regression.py"><tt class="xref download docutils literal"><span class="pre">plot_gradient_boosting_regression.py</span></tt></a></p>
@@ -201,7 +201,7 @@
201201

202202
<span class="c">###############################################################################</span>
203203
<span class="c"># Fit regression model</span>
204-
<span class="n">params</span> <span class="o">=</span> <span class="p">{</span><span class="s">&#39;n_estimators&#39;</span><span class="p">:</span> <span class="mi">500</span><span class="p">,</span> <span class="s">&#39;max_depth&#39;</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span> <span class="s">&#39;min_samples_split&#39;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
204+
<span class="n">params</span> <span class="o">=</span> <span class="p">{</span><span class="s">&#39;n_estimators&#39;</span><span class="p">:</span> <span class="mi">500</span><span class="p">,</span> <span class="s">&#39;max_depth&#39;</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span> <span class="s">&#39;min_samples_split&#39;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
205205
<span class="s">&#39;learning_rate&#39;</span><span class="p">:</span> <span class="mf">0.01</span><span class="p">,</span> <span class="s">&#39;loss&#39;</span><span class="p">:</span> <span class="s">&#39;ls&#39;</span><span class="p">}</span>
206206
<span class="n">clf</span> <span class="o">=</span> <span class="n">ensemble</span><span class="o">.</span><span class="n">GradientBoostingRegressor</span><span class="p">(</span><span class="o">**</span><span class="n">params</span><span class="p">)</span>
207207

@@ -244,8 +244,8 @@
244244
<a href="http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.show"><span class="n">plt</span><span class="o">.</span><span class="n">show</span></a><span class="p">()</span>
245245
</pre></div>
246246
</div>
247-
<p><strong>Total running time of the example:</strong> 1.16 seconds
248-
( 0 minutes 1.16 seconds)</p>
247+
<p><strong>Total running time of the example:</strong> 1.13 seconds
248+
( 0 minutes 1.13 seconds)</p>
249249
</div>
250250

251251

0 commit comments

Comments
 (0)