Commit Graph

227 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
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
Alexandre Batisse 0db80b90c7
FIX support of float32 read only input in trees (#16331) 2020-02-01 15:08:22 +01:00
Nicolas Hug 42e17b3487 MNT Removed deprecated attributes and parameters -- ctnd (#15804) 2019-12-13 15:05:51 -05: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
Adrin Jalali 19c068a2ec MNT towards removing assert_equal, etc (#14222) 2019-07-01 09:13:32 -04:00
Thomas J Fan bec83089f7
MAINT Uses pytest-xdist to parallelize tests (#13041) 2019-06-13 16:47:12 -04: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
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
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
Joel Nothman 229183bc3a TST fix: X_sparse_mix was not dense (#10484) 2018-01-17 16:12:28 +01: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
Loïc Estève e7e05d844f [MRG+1] Remove nose from CIs and documentation (#9840) 2017-11-16 20:20:35 +01:00
Loïc Estève 846313b570 [MRG+1] Deprecate sklearn.utils.testing.raises and remove it from tests (#9660) 2017-09-01 12:53:59 +02:00
Olivier Grisel 07590331c4 FIX make test_importances pass on 32 bit linux 2017-07-13 20:08:45 +02:00
(Venkat) Raghav (Rajagopalan) fc2f24927f [MRG+1] ENH/FIX Introduce min_impurity_decrease param for early stopping based on impurity; Deprecate min_impurity_split (#8449)
[MRG+2] ENH/FIX Introduce min_impurity_decrease param for early stopping based on impurity; Deprecate min_impurity_split
2017-04-03 09:38:53 -07:00
Guillaume Lemaitre 29597ca152 [MRG + 2] EHN additional test for trees regarding fitting behaviour with constant features (#8580)
* TST add test checking the behaviour of constant/no-constant features

* FIX/TST factorize test

* TST Add additional constant features

* FIX/TST remove ExtraTree from test
2017-03-13 16:39:33 -07:00
Guillaume Lemaitre 603ff1a61d FIX/TST fix bug variable name for pure test (#8562) 2017-03-09 13:23:29 +01:00
Andreas Mueller 5c4b1bb231 [MRG+1] Housekeeping Deprecations for v0.19 (#7927)
* remove stuff to be removed 0.19

* more changes

* remove classes from 0.19 whatsnew

* remove _LearntSelectorMixin

* remove ProjectedGradientNMF, load_lwf_*

* minor fixes

* remove more copy from logistic regression path

* remove lda, qda from __init__.__all__

* remove pg solver in nmf from tests etc

* remove class_weight="auto" from tests

* doctest change for decision_function_shape="ovr"

* remove transfrom from tree test, minor fixes to tree tests

* some fixes in the tests

* undo changes in functions which still allow 1d input...

* also allow 1d in scale

* more test fixes...

* last test fixes in forest and tree

* svm default value change doctest failures

* pep8

* remove more class_weight="auto" stuff

* minor cosmetics in docstrings deprecated / removed behavior.

* say that store_covariance has been moved to __init__ in discriminant_analysis
2016-12-09 12:43:38 -05:00
Ibraim Ganiev 74e4c422bd FIX #6420: Cloning decision tree estimators breaks criterion objects (#7680) 2016-10-20 10:10:50 +11:00
Nelson Liu 33ed90dc0a [MRG] FIX min_samples_split and min_samples_leaf validation for float vs int (#7604) 2016-10-10 00:39:17 +11:00
Nelson Liu da118d0cb4 [MRG+3] Fix min_weight_fraction_leaf to work when sample_weights are not provided (#7301)
* fix min_weight_fraction_leaf when sample_weights is None

* fix flake8 error

* remove added newline and unnecessary assignment

* remove max bc it's implemented in cython and add interaction test

* edit weight calculation formula and add test to check equality

* remove test that sees if two parameter build the same tree

* reword min_weight_fraction_leaf docstring

* clarify uniform weight in forest docstrings

* update docstrings for all classes

* add what's new entry

* move whatsnew entry to bug fixes and explain previous behavior
2016-09-28 14:48:23 +10:00
Olivier Grisel 7e55d99ee1 FIX broken test when run with arch -i386 on OSX 2016-08-16 17:45:51 +02:00
James Fiedler e4b837cc66 Removed unused imports 2016-07-29 19:30:23 -05:00
Nelson Liu 376aa50e70 [MRG+1] feature: add beta-threshold early stopping for decision tree growth (#6954)
* feature: add beta-threshold early stopping for decision tree growth

* check if value of beta is greater than or equal to 0

* test if default value of beta is 0 and edit input validation error message

* feature: separately validate beta for reg. and clf., and add tests for it

* feature: add beta to forest-based ensemble methods

* feature: add separate condition to determine that beta is float

* feature: add beta to gradient boosting estimators

* rename parameter to min_impurity_split, edit input validation and associated tests

* chore: fix spacing in forest and force recompilation of grad boosting extension

* remove trivial comment in grad boost and add whats new

* edit wording in test comment / rebuild

* rename constant with the same name as our parameter

* edit line length for what's new

* remove constant and set min_impurity_split to 1e-7 by default

* fix docstrings for new default

* fix defaults in gradientboosting and forest classes
2016-07-27 17:46:49 +02:00
Nelson Liu c84ff5e351 [MRG+3] Add mean absolute error splitting criterion to DecisionTreeRegressor (#6667)
* feature: add initial node_value method

* testing code for node_impurity and node_value

This code runs into 'Bus Error: 10' at node_value final assignment.

* fix: node_value now correctly calculating weighted median for sorted data.

Still need to change the code to work with unsorted data.

* fix: node_value now correctly calculates median regardless of initial order

* fix: correct bug in calculating median when taking midpoint is necessary

* feature: add initial version of children_impurity

* feature: refactor median calculation into one function

* fix: fix use of DOUBLE_t vs double

* feature: move helper functions to _utils.pyx, fix mismatched pointer type

* fix: fix some bugs in children_impurity method

* push a debug version to try to solve segfault

* push latest changes, segfault probably happening bc of something in _utils.pyx

* fix: fix segfault in median calculation and remove excessive logging

* chore: revert some misc spacing changes I accidentally made

* chore: one last spacing fix in _splitter.pyx

* feature: don't calculate weighted median if no weights are passed in

* remove extraneous logging statement

* fix: fix children impurity calculation

* fix: fix bug with children impurity not being initally set to 0

* fix: hacky fix for a float accuracy error

* fix: incorrect type cast in median array generation for node_impurity

* slightly tweak node_impurity function

* fix: be more explicit with casts

* feature: revert cosmetic changes and free temporary arrays

* fix: only free weight array in median calcuation if it was created

* style: remove extraneous newline / trigger CI build

* style: remove extraneous 0 from range

* feature: save sorts within a node to speed it up

* fix: move parts of dealloc to regression criterion

* chore: add comment to splitter to try to force recythonizing

* chore: add comment to _tree.pyx to try to force recythonizing

* chore: add empty comment to gradient boosting to force recythonizing

* fix: fix bug in weighted median

* try moving sorted values to a class variable

* feature: refactor criterion to sort once initially, then draw all samples from this sorted data

* style: remove extraneous parens from if condition

* implement median-heap method for calculating impurity

* style: remove extra line

* style: fix inadvertent cosmetic changes; i'll address some of these in a separate PR

* feature: change minmaxheap to internally use sorted arrays

* refactored MAE and push to share work

* fix errors wrt median insertion case

* spurious comment to force recythonization

* general code cleanup

* fix typo in _tree.pyx

* removed some extraneous comments

* [ci skip] remove earlier microchanges

* [ci skip] remove change to priorityheap

* [ci skip] fix indentation

* [ci skip] fix class-specific issues with heaps

* [ci skip] restore a newline

* [ci skip] remove microchange to refactor later

* reword a comment

* remove heapify methods from queue class

* doc: update docstrings for dt, rf, and et regressors

* doc: revert incorrect spacing to shorten diff

* convert get_median to return value directly

* [ci skip] remove accidental whitespace

* remove extraneous unpacking of values

* style: misc changes to identifiers

* add docstrings and more informative variable identifiers

* [ci skip] add trivial comments to recythonize

* remove trivial comments for recythonizing

* force recythonization for real this time

* remove trivial comments for recythonization

* rfc: harmonize arg. names and remove unnecessary checks

* convert allocations to safe_realloc

* fix bug in weighted case and add tests for MAE

* change all medians to DOUBLE_t

* add loginc allocate mediancalculators once, and reset otherwise

* misc style fixes

* modify cinit of regressioncriterion to take n_samples

* add MAE formula and force rebuild bc. travis was down

* add criterion parameter to gradient boosting and add forest tests

* add entries to what's new
2016-07-25 08:44:59 +02:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00