Commit Graph

17 Commits

Author SHA1 Message Date
Thomas J. Fan 82df48934e
MNT Applies black formatting to most of the code base (#18948) 2021-06-17 14:21:09 -04:00
Adrin Jalali 437ca0553c MNT Makes modules in tree and ensemble private (#14964) 2019-10-16 10:39:00 -04:00
Stephen Cowley e7ca6236c5 Fix spacing and formatting inconsistencies (#13747) 2019-05-02 01:29:49 +10:00
Giuseppe Vettigli a061ada48e FEA Print Decision Trees in ASCII format (#9424) 2019-02-12 10:23:48 +11:00
Andreas Mueller c13ba26c47
[MRG] Matplotlib tree plotting (#9251)
* add reingold tillford tree layout algorithm

* add first silly implementation of matplotlib based plotting for trees

* object oriented design for export_graphviz so it can be extended

* add class for mlp export

* add colors

* separately scale x and y, add arrowheads, fix strings

* implement max_depth

* don't use alpha for coloring because it makes boxes transparent

* remove unused variables

* vertical center of boxes

* fix/simplify newline trimming

* somewhere in the middle of stuff

trying to get rid of scalex, scaley

* remove "find_longest_child" for now, fix tests

* make scalex and scaley internal, and ax local.

render everything once to get the bbox sizes, then again to actually plot it with known extents.

* add some margin to the max bbox width

* add _BaseTreeExporter baseclass

* add docstring to plot_tree

* use data coordinates so we can put the plot in a subplot, remove some hacks.

* remove scalex, scaley, add automatic font size

* use rendered stuff for setting limits (well nearly there)

* import plot_tree into tree module

* set limits before font size adjustment?

* add tree plotting via matplotlib to iris example and to docs

* pep8 fix

* skip doctest on plot_tree because matplotlib is not installed on all CI machines

* redo everything in axis pixel coordinates

re-introduce scalex, scaley
add max_extents to tree to get tree size before plotting

* fix max-depth

parent node positioning and don't consider deep nodes in layouting

* consider height in fontsize computation

in case someone gave us a very flat figure

* fix error when max_depth is None

* add docstring for tree plotting fontsize

* starting on jnothman's review

* renaming fixes

* whatsnew for tree plotting

* clear axes prior to doing anything.

* fix doctests

* skip matplotlib doctest

* trying to debug circle failure

* trying to show full traceback

* more print debugging

* remove debugging crud

* hack around matplotlib <1.5 issues

* copy bbox args because old matplotlib is weird.

* pep8 fixes

* add explicit boxstyle

* more pep8

* even more pep8

* add comment about matplotlib version requirement

* remove redundant file

* add whatsnew entry that the merge lost

* fix merge issue

* more merge issues

* whitespace ...

* remove doctest skip to see what's happening

* added some simple invariance tests buchheim function

* refactor
___init__ into superclass

* added some tests of plot_tree

* put skip back in, fix typo, fix versionadded number

* remove unused parameters special_characters and parallel_leaves from mpl plotting

* rename tests to test_reingold_tilford

* added license header from pymag-trees repo

* remove duplicate test file.
2018-10-11 15:42:02 -04:00
Gilles Louppe e084727613 ENH: moved export_graphviz to sklearn/tree/export.py 2013-04-16 12:29:58 +02:00
Andreas Mueller 754c2d9533 COSMIT pep8 2012-12-22 16:48:17 +01:00
Gilles Louppe b25c574b76 DOC: Standardized the module documentation format (2) 2011-11-30 11:05:10 +01:00
Gilles Louppe dfd924c2b3 DOC: Added module descriptions 2011-11-12 12:19:16 +01:00
Gilles Louppe 7bd3f88ff1 Rebase of @bdholt1's ensemble branch 2011-11-12 11:29:38 +01:00
Gilles Louppe 5975f4ce38 Removed extra-trees from __init__ 2011-11-09 21:04:25 +01:00
Gilles Louppe 951b9973ae Completed documentation 2011-11-07 10:54:14 +01:00
Gilles Louppe 3e04da6763 Fixed bugs in forest + first test 2011-11-04 14:19:58 +01:00
Brian Holt c5ad2c5aa5 rewrote GraphvizExporter into a function export_graphviz 2011-09-26 10:57:39 +01:00
Brian Holt 625b35846a Incorporated suggested changes to Graphviz exporter
Renamed Visitor to Exporter
Moved all write functions into the exporter
Removed Leaf class (only use Node class, so that samples and error are shown)
Assign nodes a repeatable unique id
Replaced .png files with .svg files
2011-09-12 16:00:49 +01:00
Brian Holt b8d4d4ba9e renamed scikits.learn to sklearn 2011-09-05 21:07:33 +01:00
Brian Holt b484aa4432 merged upstream-master into enh/tree 2011-09-03 13:04:27 +01:00