Commit Graph

271 Commits

Author SHA1 Message Date
Juan Carlos Alfaro Jiménez e4ebcbcafd
MNT Deprecate X_idx_sorted in tree module (#17614) 2020-06-17 13:58:47 -04:00
Lucy Liu f27adc51d5
TST Replace Boston dataset in test_tree (#17290) 2020-06-01 16:55:26 -04:00
Nicolas Hug ac8cbb3799
[MRG] More deprecation for 0.24 (#17142)
* normalize_components in sparsePCA

* changed default strategy of Dummy to prior and removed outputs_2d ttribute

* removed usage of None to drop estimator in ensemble and behaviour param of IsolationForest

* remove support for drop=None in Voting

* removed some warning decorators

* remove feature_extraction.extract_patches

* removed VectorizerMixin and copy parameter from TFIDFVectorizer

* kernel.set_params now raises attributeerror

* removed fig from plot_partial_dependence

* removed iid parameter of search estimators

* removed brier_scorer

* raise error in split when shuffle is False and random_state is not None

* removed MultiOutputEstimator

* removed base classes of NaiveBayes

* removed drop from pipeline

* removed utils in random_projection

* removed presort and classes_ in trees

* flake8

* fixed some tests

* flake

* fixed docstring

* fixed other one

* some left

* mmmm
2020-05-20 16:04:14 -04:00
Thomas J Fan 388999b59d
API Deprecate positional arguments in tree module (#16966) 2020-04-22 09:20:57 -04:00
Roman Yurchak 1cbe59ee06
CI Check for unused imports when linting (#16678)
* Check for missing imports in linting

* Exclude externals

* Remove unused imports
2020-03-12 12:56:35 +01:00
Sergul Aydore 78dc5974d5
TST check sample_weight shape added to common tests (#11598) 2020-02-21 10:04:09 -05:00
Roman Feldbauer 9b39c4c4d2
TST Fix unreachable code in tests (#16110) 2020-02-16 14:41:26 +01:00
Alexandre Batisse 0db80b90c7
FIX support of float32 read only input in trees (#16331) 2020-02-01 15:08:22 +01:00
Rick Mackenbach c6fe262bc6
ENH Improve error message for not fitted trees in plot_tree (#16253) 2020-01-29 10:33:42 +01:00
Nicolas Hug 42e17b3487 MNT Removed deprecated attributes and parameters -- ctnd (#15804) 2019-12-13 15:05:51 -05:00
Chiara Marmo 9c62eee695 MNT Deprecate unused 'rotate' parameter in tree.plot_tree. (#15806)
* Deprecate unused 'rotate' parameter in tree.plot_tree.

* Clarify warning and docstring. Add test.

* Fix lint error and adress comment.

* Fix python lint error.

* Add what's new entry. Conform to skl convention.

* Update sklearn/tree/tests/test_export.py

Co-Authored-By: Olivier Grisel <olivier.grisel@ensta.org>
2019-12-07 18:36:40 +01:00
Nicolas Hug 12c2b40761
MNT Remaining deprecations in sklearn/file.py (#15399) 2019-11-04 14:22:42 -05:00
Fanny bcb8eda383 MNT Standardize sample weights validation in BaseDecisionTree (#15495)
* Standardize sample weights validation in BaseDecisionTree

Co-authored-by: Sallie Walecka <sallie.walecka@gmail.com>

* Use DOUBLE var instead of np.float64 & refactored test

Co-authored-by: Sallie Walecka <sallie.walecka@gmail.com>
2019-11-04 17:13:38 +01:00
Nicolas Hug 19ad136223 MNT Replace DeprecationWarning with FutureWarning (#15080)
* bruteforce renaming

* WIP

* WIP

* some more

* removed weird line

* update -Werror

* testiforest

* again

* Fixed some tests

* fixed some tests

* removed -Werror

* fixed test_docstring_param issue

* fixed some tests

* some more

* renamed to SklearnDeprecationWarning

* pep8

* updated docs

* pep8

* merge

* changed to FutureWarning

* fixes

* Update doc/developers/tips.rst

Co-Authored-By: Adrin Jalali <adrin.jalali@gmail.com>

* avoid duplicates

* fixed warning for deprecations

* Still make CI break if DeprecationWarning isn't caught

* updated one warning

* fixed test

* fixed some renamings

* updated new dep warnings

* fixed bad import

* ignore warnings

* update again

* ignore futurewarning when walking packages

* Fixed test

* pep8

* Added whatsnew
2019-10-29 15:39:26 +01:00
Nicolas Hug b92455a6b2 MAINT Deprecate all of utils.testing except all_estimators (#15367) 2019-10-28 17:28:56 +01:00
Adrin Jalali 437ca0553c MNT Makes modules in tree and ensemble private (#14964) 2019-10-16 10:39:00 -04:00
Rok Mihevc 5e4b2757d6 TST Adding multi-output checks to common tests (#13392) 2019-10-01 14:20:11 +02:00
Adrin Jalali 186629b60a MNT Deprecate {n_}classes_ attribute for tree regressors (#15028) 2019-09-20 07:27:21 -04:00
Adrin Jalali 99d3d34d61
MNT deprecating presort in DecisionTree* and GradeintBoosting* (#14907)
* deprecating presort

* pep8

* address comments, add whats_new

* recomment HistGradientBoosting

* address comments
2019-09-10 20:39:52 +02:00
Samesh Lakhotia e74e03294a MAINT: Fix assert raises in `sklearn/tree/tests/` (#14737) 2019-08-28 10:00:58 +03:00
Thomas J Fan 67c94c7e2a Add Minimal Cost-Complexity Pruning to Decision Trees (#12887) 2019-08-20 09:02:45 -04:00
Nicolas Hug f3eb9d2206 [MRG] MNT removing assert_equal, etc -- continued (#14232) 2019-07-02 14:53:51 +10:00
Adrin Jalali 19c068a2ec MNT towards removing assert_equal, etc (#14222) 2019-07-01 09:13:32 -04:00
Thomas J Fan e2b6bff0ac BUG Fixes export_text with single feature (#14053) 2019-06-18 14:51:00 +02:00
Thomas J Fan bec83089f7
MAINT Uses pytest-xdist to parallelize tests (#13041) 2019-06-13 16:47:12 -04:00
Roman Yurchak ccd3331f7e MNT remove unused imports (#14021) 2019-06-04 23:15:19 +10:00
Frank Hoang fa383a4aca FIX plot_tree now displays correct criterion (#13947) 2019-05-27 17:43:11 +10:00
Guillaume Lemaitre b34751b7ed [MRG] MAINT: add fixture for init and clean-up with matplotlib (#13708) 2019-05-06 09:41:46 +02:00
jeremiedbb 5bc3edccab BUG Fix missing 'const' in a few memoryview declaration in trees. (#13626) 2019-04-16 07:08:04 -04:00
Roman Yurchak cf9a740598 [MRG+1] Use astype(.., copy=False) when possible (#11973)
* Use astype(.., copy=False) when possible

* Use Use astype(.., copy=False) also in tests

* Fix CI

* Guillaume's comments

* Address review comments

* Add what's new

* Fix CI

* Lint

* Fix merge issues

* More merge conflict fixes

* Fix failing test

* Lint

* Use copy=True in cluster/hierarchical

* More fixes
2019-03-01 11:07:10 +01:00
Mitar 95993a4b2b FIX Fixes tree and forest classification for non-numeric multi-target (#11458)
* Fixes tree and forest classification for non-numeric multi-target.

Fixes #11451.

* Renaming test functions, adding dtype to predictions array in tree.py.

* Fixing flake8 issue.

* Adding ignore warning to test_forest.py.

* Switching to iris data for tests.
2019-02-19 10:46:30 +01:00
Giuseppe Vettigli a061ada48e FEA Print Decision Trees in ASCII format (#9424) 2019-02-12 10:23:48 +11:00
Roman Yurchak acb8106472 MNT Use list and dict comprehension (#12668) 2019-01-08 09:32:34 +11:00
Andreas Mueller 952ef6637a MRG Drop legacy python / remove six dependencies (#12639) 2019-01-03 15:50:05 +02:00
Bartosz Michałowski fa98a72dcc MNT Replaced all occurrences of assert_true and assert_false with assert (#12588) 2018-11-28 09:16:26 +08:00
Adrin Jalali 02dc9ed680 Fix max_depth overshoot in BFS expansion of trees (#12344)
* fix the issue with max_depth and BestFirstTreeBuilder

* fix the test

* fix max_depth overshoot in BFS expansion

* fix forest tests

* remove the warning, add whats_new entry

* remove extra line

* add affected classes to changed classes

* add other affected estimators to the whats_new changed models

* shorten whats_new changed models entry
2018-11-13 13:10:33 -05: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
Adrin Jalali a80bbd9403 ENH add get_n_leaves() and get_max_depth() to DesicionTrees (#12300) 2018-10-10 22:01:11 +11:00
Joel Nothman 79f5d147ea MNT Revert the deprecation of min_samples_leaf and min_weight_fraction_leaf (#11998) 2018-09-08 16:43:21 +02:00
Joel Nothman 2fe58e517c Deprecate min_samples_leaf and min_weight_fraction_leaf (#11870) 2018-08-23 08:30:47 +03:00
jakirkham 4c8dec33c4 [MRG] MNT: Avoid extra copies when using asfortranarray (#11693) 2018-07-29 13:41:59 +10:00
ZJ Poh adddf00433 [MRG] np.ones -> np.full (#11628) 2018-07-23 09:49:01 +02:00
JohnStott 6ade12a55b [MRG+2] Tree MAE fix to ensure sample_weights are used during impurity calculation (#11464)
* Fix to allow M

* Updated MAE test to consider sample_weights in calculation

* Removed comment

* Fixed: E501 line too long (82 > 79 characters)

* syntax correction

* Added fix details

* Changed to use consistent datatypes during calculaions

* Corrected formatting

* Requested Changes

* removed explicit casts

* Removed unnecessary explicits

* Removed unnecessary explicit casts

* added additional test

* updated comments

* Requested changes incl additional unit test

* fix mistake

* formatting

* removed whitespace

* added test notes

* formatting

* Requested changes

* Trailing space fix attempt

* Trailing whitespace fix attempt #2

* Remove trailing whitespace
2018-07-17 14:49:20 +02:00
Roman Yurchak e8d8b8eeb0 TST: parametrize unit tests (#11074)
yield tests are deprecated in pytest and will be removed in pytest 4.0.
They all have been replaced by parametrize.
2018-06-08 14:59:33 +02:00
Jonathan Ohayon 2b835a0ce8 [MRG+1] change threshold computation in trees (#10536) 2018-02-08 11:09:52 -08:00
ksemb 77418a0275 MAINT Fix escape sequences that are deprecated in Python 3.6 (#10578)
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
2018-02-07 10:41:21 +11:00
Joel Nothman 229183bc3a TST fix: X_sparse_mix was not dense (#10484) 2018-01-17 16:12:28 +01:00
Mabel c62338feb5 FIX export_graphviz should work with a sklearn.tree._tree.Tree (#10234) 2017-12-04 13:28:19 +11:00
fenx 4bba21659c [MRG+1] Error raised when presort in gradient_boosting.py and tree.py is not a boolean (#10110) 2017-11-28 13:27:13 +01:00
FarahSaeed 439bf1ac89 TEST caught deprecation warning for min_impurity_split (#10202) 2017-11-27 21:40:47 +11:00