@@ -146,6 +146,10 @@ Once trained, you can plot the tree with the :func:`plot_tree` function::
146
146
:scale: 75
147
147
:align: center
148
148
149
+ |details-start |
150
+ **Alternative ways to export trees **
151
+ |details-split |
152
+
149
153
We can also export the tree in `Graphviz
150
154
<https://www.graphviz.org/> `_ format using the :func: `export_graphviz `
151
155
exporter. If you use the `conda <https://conda.io >`_ package manager, the graphviz binaries
@@ -212,6 +216,8 @@ of external libraries and is more compact:
212
216
| | |--- class: 2
213
217
<BLANKLINE>
214
218
219
+ |details-end |
220
+
215
221
.. topic :: Examples:
216
222
217
223
* :ref: `sphx_glr_auto_examples_tree_plot_iris_dtc.py `
@@ -281,7 +287,6 @@ of shape ``(n_samples, n_outputs)`` then the resulting estimator will:
281
287
* Output a list of n_output arrays of class probabilities upon
282
288
``predict_proba ``.
283
289
284
-
285
290
The use of multi-output trees for regression is demonstrated in
286
291
:ref: `sphx_glr_auto_examples_tree_plot_tree_regression_multioutput.py `. In this example, the input
287
292
X is a single real value and the outputs Y are the sine and cosine of X.
@@ -303,16 +308,20 @@ the lower half of those faces.
303
308
304
309
.. topic :: Examples:
305
310
306
- * :ref: `sphx_glr_auto_examples_tree_plot_tree_regression_multioutput.py `
307
- * :ref: `sphx_glr_auto_examples_miscellaneous_plot_multioutput_face_completion.py `
311
+ * :ref: `sphx_glr_auto_examples_tree_plot_tree_regression_multioutput.py `
312
+ * :ref: `sphx_glr_auto_examples_miscellaneous_plot_multioutput_face_completion.py `
308
313
309
- .. topic :: References:
314
+ |details-start |
315
+ **References **
316
+ |details-split |
310
317
311
318
* M. Dumont et al, `Fast multi-class image annotation with random subwindows
312
319
and multiple output randomized trees
313
320
<http://www.montefiore.ulg.ac.be/services/stochastic/pubs/2009/DMWG09/dumont-visapp09-shortpaper.pdf> `_, International Conference on
314
321
Computer Vision Theory and Applications 2009
315
322
323
+ |details-end |
324
+
316
325
.. _tree_complexity :
317
326
318
327
Complexity
@@ -403,6 +412,10 @@ Tree algorithms: ID3, C4.5, C5.0 and CART
403
412
What are all the various decision tree algorithms and how do they differ
404
413
from each other? Which one is implemented in scikit-learn?
405
414
415
+ |details-start |
416
+ **Various decision tree algorithms **
417
+ |details-split |
418
+
406
419
ID3 _ (Iterative Dichotomiser 3) was developed in 1986 by Ross Quinlan.
407
420
The algorithm creates a multiway tree, finding for each node (i.e. in
408
421
a greedy manner) the categorical feature that will yield the largest
@@ -428,6 +441,8 @@ it differs in that it supports numerical target variables (regression) and
428
441
does not compute rule sets. CART constructs binary trees using the feature
429
442
and threshold that yield the largest information gain at each node.
430
443
444
+ |details-end |
445
+
431
446
scikit-learn uses an optimized version of the CART algorithm; however, the
432
447
scikit-learn implementation does not support categorical variables for now.
433
448
@@ -500,8 +515,9 @@ Log Loss or Entropy:
500
515
501
516
H(Q_m) = - \sum _k p_{mk} \log (p_{mk})
502
517
503
-
504
- .. note ::
518
+ |details-start |
519
+ Shannon entropy:
520
+ |details-split |
505
521
506
522
The entropy criterion computes the Shannon entropy of the possible classes. It
507
523
takes the class frequencies of the training data points that reached a given
@@ -531,6 +547,8 @@ Log Loss or Entropy:
531
547
532
548
\mathrm {LL}(D, T) = \sum _{m \in T} \frac {n_m}{n} H(Q_m)
533
549
550
+ |details-end |
551
+
534
552
Regression criteria
535
553
-------------------
536
554
@@ -671,7 +689,9 @@ be pruned. This process stops when the pruned tree's minimal
671
689
672
690
* :ref: `sphx_glr_auto_examples_tree_plot_cost_complexity_pruning.py `
673
691
674
- .. topic :: References:
692
+ |details-start |
693
+ **References **
694
+ |details-split |
675
695
676
696
.. [BRE ] L. Breiman, J. Friedman, R. Olshen, and C. Stone. Classification
677
697
and Regression Trees. Wadsworth, Belmont, CA, 1984.
@@ -685,3 +705,5 @@ be pruned. This process stops when the pruned tree's minimal
685
705
686
706
* T. Hastie, R. Tibshirani and J. Friedman. Elements of Statistical
687
707
Learning, Springer, 2009.
708
+
709
+ |details-end |
0 commit comments