Commit Graph

68 Commits

Author SHA1 Message Date
Thomas J. Fan d400723a21
FEA Add DecisionBoundaryDisplay (#16061)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
2022-03-29 16:36:31 +02:00
Thomas J. Fan 77fbdd1c46
FIX Fixes plot_tree from going out of bounds (#21917) 2021-12-08 14:04:06 +01:00
Dimitri Papadopoulos Orfanos d4d5f8c7e0
MAINT consistent use of `print(__doc__)` in examples (#21307)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-10-22 15:33:22 +02:00
Thomas J. Fan 70a185ae59
MAINT Enable and run black on examples (#20502) 2021-10-07 10:13:00 +02:00
Roman Yurchak 94f2e9c5d8
DOC simpler block delimitation in sphinx-gallery examples (#17068)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2020-06-08 23:23:14 -04:00
Lucy Liu d46663c481
DOC Update/clarify plot_unveil_tree_structure.py (#16942) 2020-05-19 08:58:46 +02:00
Tirth Patel 0a80ee9ecd [DOC] fix syntax error for reference in plot_cost_complexity_pruning.py (#15423) 2019-11-01 06:55:18 +11:00
Thomas J Fan 67c94c7e2a Add Minimal Cost-Complexity Pruning to Decision Trees (#12887) 2019-08-20 09:02:45 -04:00
Joel Nothman 486f8fc543 DOC fix plot_iris references after files renamed 2019-01-17 23:31:48 +11:00
Adrin Jalali 69c8967e21 DOC Fix warnings in examples (#12654)
Fixe or suppresses many warnings in examples, including matplotlib complaining about the non-gui backend.
2019-01-17 21:41:13 +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
Bangda Sun 07f2831599 DOC Fix code typo in plot_unveil_tree_structure.py (#10951) 2018-04-11 12:35:29 +10:00
Hanmin Qin 32ac22870d [MRG+1] Fix warnings in lgtm.com (remove redundant code) (#9719) 2017-09-14 11:42:58 +02:00
Hanmin Qin cb16003751 DOC Improve the output of example plot_iris.py after matplotlib2.0 (#9541) 2017-08-16 09:01:28 +10:00
Aarshay Jain 6986e9b5db [MRG + 1] 18 more examples with matplotlib 2.0 updates (#8983)
* updated plot_label_propagation_versus_svm_iris.py plot

* updated svm/plot_weighted_samples.py plot

* made semi_supervised/plot_label_propagation_versus_svm_iris.py pep8 compliant

* modified tree/plot_tree_regression.py [size and edgecolor]

* updated tree/plot_tree_regression_multioutput.py [size+color]

* fixed examples/semi_supervised/plot_label_propagation_versus_svm_iris.py for backward compatibility

* neural_networks/plot_mlp_alpha.py - matplotlib2 update

* examples/neural_networks/plot_mlp_alpha.py - pep8 fix

* examples/neighbors/plot_nearest_centroid.py - matplotlib2.0 + pep8 fix

* neighbors/plot_classification.py - matplotlib2.0 + pep8 fix

* examples/neighbors/plot_lof.py - matplotlib2.0 update

* examples/model_selection/plot_underfitting_overfitting.py - matplotlib2.0 + pep8

* examples/mixture/plot_concentration_prior.py - matplotlib2.0 + pep8

* examples/linear_model/plot_logistic_multinomial.py - matplotlib2.0 update

* linear_model/plot_sgd_iris.py - matplotlib2.0 + pep8 fix

* examples/linear_model/plot_sgd_weighted_samples.py - matplotlib2.0 + pep8

* examples/linear_model/plot_sgd_separating_hyperplane.py - matplotlib2.0 update

* examples/feature_selection/plot_permutation_test_for_classification.py - matplotlib + pe8

* examples/linear_model/plot_bayesian_ridge.py - matplotlib2.0 update

* examples/feature_selection/plot_feature_selection.py - matplotlib2.0 update

* examples/feature_selection/plot_f_test_vs_mi.py - matplotlib2.0 + pep8

* examples/feature_selection/plot_f_test_vs_mi.py - matplotlib2.0+ pep8 fix

* examples/model_selection/plot_underfitting_overfitting.py - error fixed

* blue -> black edgecolor fix for 2 examples
2017-06-07 13:23:12 +02:00
David Heryanto 7877f3cfae [MRG] Fix plot_unveil_tree_structure.py: incorrect indexing for X_test (#8653) 2017-03-27 18:54:52 +02:00
Aman Dalmia 13cc121b30 [MRG] Remove DeprecationWarnings in examples due to using floats instead of ints (#8040) 2017-02-03 15:21:03 +01:00
brady salz 1a61441912 DOC Fix typo in plot_unveil_tree_structure (#7988)
Extra `s` added, changed `%ss` to `%s`
2016-12-06 12:13:10 +11:00
Nelson Liu 82f913d72a
rename unveil_tree_structure example to enable CI on it 2016-08-30 18:18:24 -06:00
Olivier Grisel 637cebbdf5 FIX restore previous title layout in examples/tree/plot_iris.py 2016-02-04 16:09:36 +01:00
Olivier Grisel 864f1c06a8 Merge pull request #6264 from yenchenlin1994/fix-multioutput-regression-tree-example
[MRG+1]Fix axis label in the plot of multioutput regression tree example
2016-02-04 11:04:05 +01:00
YenChenLin e20e003be5 Fix axis label of multioutput regression tree example 2016-02-02 10:39:47 +08:00
Panos Louridas bb0a6325de move title in the bottom 2016-01-29 17:03:35 +02:00
Panos Louridas c0e4832d08 remove shuffling and standardization fix layout 2016-01-28 18:16:31 +02:00
Rémy Léone 2199e50f34 Migrate examples to avoid deprecated module 2015-11-01 22:22:37 +01:00
johannah 8108bdb6fb Made plots colorblind friendly 2015-10-23 11:30:16 +02:00
Arnaud Joly 3fbd3b9ade Take into account ngoix comment 2015-10-22 09:51:14 +02:00
Arnaud Joly 7ad90f5a33 Rename since we don't plot anything 2015-10-21 18:08:57 +02:00
Arnaud Joly 4d0ba3ca58 wording 2015-10-21 17:09:38 +02:00
Arnaud Joly ec8fbefcb9 Take into account amueller comments 2015-10-21 17:05:57 +02:00
Arnaud Joly c9888a6f8d Take into account glouppe comments 2015-10-21 17:05:56 +02:00
Arnaud Joly 405c71780f typo 2015-10-21 17:05:56 +02:00
Arnaud Joly bc02bd5243 ENH rename decision_paths to decision_path 2015-10-21 17:05:56 +02:00
Arnaud Joly 4d9a955933 DOC make visualizatoin aware of the tree depth 2015-10-21 17:05:55 +02:00
Arnaud Joly 317281bf22 take glouppe comment 2015-10-21 17:05:55 +02:00
Arnaud Joly 392ef504ec DOC add an example highlighting the tree structure 2015-10-21 17:05:55 +02:00
rasbt c655bb9b0e changed clf to regr in decision tree regression examples 2015-06-17 15:20:23 -04:00
ugurthemaster e6b1863af0 Update plot_tree_regression.py
Import statements have been moved to the beginning of the file.
2014-08-01 13:28:03 +03:00
Andreas Mueller 5b247f90e4 move around examples for better structure. 2014-07-17 09:35:30 +02:00
Rajat Khanduja cca6fc7e8b Some more examples updated to use matplotlib.pyplot 2014-05-16 09:42:02 +05:30
Rajat Khanduja 7d10d98492 Fixed some PEP8 violations even present in master branch, in examples/
This fixes some of the violations that were not caused by the change to pyplot
from pylab.
2014-05-15 09:35:24 +05:30
Rajat Khanduja 5e20b8c664 Fixed pep8 violations. Some 'line too long' errors still remain. 2014-05-15 09:23:16 +05:30
Rajat Khanduja 2244098532 Updated examples to use pyplot for plotting instead of pylab
Some examples not updated because scripts throw error (probably not
because of the change)
2014-05-15 02:18:07 +05:30
ugurthemaster 8e162a0805 Update plot_tree_regression_multioutput.py
Import statements have been moved to the top of the file.
2014-01-23 16:42:39 +02:00
Jaques Grobler cbfe851751 example fixes to clean first docstring paragraph of rst code 2013-07-22 15:48:44 +02:00
Stefano Lattarini 67ece78da4 COSMIT various typofixes
As suggested by codespell <https://github.com/lucasdemarchi/codespell>

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-04-11 21:22:14 +02:00
Lars Buitinck 541987802f P3K range vs. xrange 2013-02-14 02:05:35 +01:00
Lars Buitinck 837093df7f P3K: use print as a function in the examples
Also corrected some typos, including two people misspelling their own names :)
2013-02-01 15:04:42 +01:00
Andreas Mueller 38b455d541 Cosmit pep8 2012-12-25 13:16:05 +01:00
Andreas Mueller 001a681513 COSMIT pep8 2012-07-15 13:35:08 +01:00