Commit Graph

1074 Commits

Author SHA1 Message Date
Frans Larsson 2e083df41a
DOC Fix default values and add None to random_state in tree._classes.py (#18291)
Co-authored-by: Juan Carlos Alfaro Jiménez <JuanCarlos.Alfaro@uclm.es>
2020-08-31 13:58:23 +02:00
Nicolas Hug 22f232efc6
MNT remove duplicated call to children_impurity() in tree code (#18203)
Co-authored-by: Juan Carlos Alfaro Jiménez <JuanCarlos.Alfaro@uclm.es>
2020-08-21 10:32:30 +02:00
Qi Zhang e217b68fd0
FIX Fix a cross-platform endian issue in trees (#17644)
* fixed a cross-platform endian issue

* removed a duplicated dtype checking

* Trigger [arm64] CI

* added an entry to doc/whats_new/v0.24.rst

* moved my fix entry to sklearn.tree section

* Update sklearn/tree/_tree.pyx

Added comments

Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>

* code simplified

* fixed a typo in sklearn/tree/_tree.pyx

* Update doc/whats_new/v0.24.rst

Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>

* updated doc/whats_new/v0.24.rst

* Update sklearn/tree/_tree.pyx

Added a space after "if", to be PEP8 compliant.

Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>

* Update sklearn/tree/_tree.pyx

Co-authored-by: Qi Zhang <q.zhang@ibm.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2020-08-12 16:43:09 +02:00
Ivan Wiryadi db968e2d14
DOC Fix documentation of default values in tree exports (#17834)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Juan Carlos Alfaro Jiménez <JuanCarlos.Alfaro@uclm.es>
2020-07-10 10:13:16 +02:00
Thomas9292 a8067f7190
DOC Add tiebreaking explanation to DecisionTreeClassifier docs (#17783)
Co-authored-by: Juan Carlos Alfaro Jiménez <JuanCarlos.Alfaro@uclm.es>
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Co-authored-by: thomas.wesselink@ing.com <thomas.wesselink@ing.com>
2020-07-04 16:35:16 -04:00
Thomas J. Fan 7cc0177f8e
MNT Replaces numpy alias with builtin typse (#17687)
* MNT Replaces numpy alias with builtin typse

* STY Lint error
2020-06-24 16:51:51 +02:00
Jorge Gorbe Moya c11aaf5a66
FIX undefined behavior in _tree.pyx and _quad_tree.pyx (#17228)
* Fix undefined behavior in _tree.pyx and  _quad_tree.pyx

Accessing a member through a null pointer is undefined behavior, even if
no actual memory access is performed (like in this case, where it was
used only for offset computation). See the following link for an
explanation:
https://software.intel.com/content/www/us/en/develop/blogs/null-pointer-dereferencing-causes-undefined-behavior.html

The current approach will also fail when building with tools like ubsan
(undefined behavior sanitizer).

The standard way to compute offsets of struct members is the offsetof
macro but it seems it's not supported by Cython so I've used the
approach described here:

https://mail.python.org/pipermail/cython-devel/2013-April/003505.html

* Simplify definitions of types for numpy.

According to
9e9cdb0192 (issuecomment-638998985)
these dictionaries with offsets are there for old numpy versions and
they are no longer needed. We can use instead an approach similar to
https://github.com/scikit-learn/scikit-learn/pull/15097/files#diff-b071106a87a03ee4e9149e3f0a2b1180L187

I have verified that tests keep passing and that the undefined behavior
that motivated this pull request in the first place is still fixed.

* Document the new numpy type definition approach.

Added a brief comment and a link to stackoverflow thread that explain
why the simpler approach to define numpy types works.

* Fix typo 'dtyle'->'dtype'
2020-06-22 14:11:58 +02:00
Roman Yurchak 8ab0064579
MNT Fix build with Cython 3.0a5 (#17627) 2020-06-18 15:10:11 +02:00
Juan Carlos Alfaro Jiménez e4ebcbcafd
MNT Deprecate X_idx_sorted in tree module (#17614) 2020-06-17 13:58:47 -04:00
Max Del Giudice 2253807bb4
DOC fixed default values in doc string for plot_tree (#17496) 2020-06-06 16:49:27 -04:00
Lucy Liu f27adc51d5
TST Replace Boston dataset in test_tree (#17290) 2020-06-01 16:55:26 -04:00
Andreas Mueller 2f26540ee9
ENH use colors from style in tree plotting (#17187) 2020-05-21 10:30:39 +10: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
Nicolas Hug 089c8a17a1
[MRG] MNT requires_y tag with y=None validation (#16622) 2020-04-22 22:41:45 +10:00
Lucy Liu c2b31ac21b
DOC replace Boston in _classes.py (#16892)
* replace boston

* fix score
2020-04-14 10:42:15 +02: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
Katrina Ni f7fd231ab4
DOC add example to tree.ExtraTreeClassifier (#16671)
Co-authored-by: Jonathan Rahn <jonathan.rahn@42digital.de>
Co-authored-by: Katrina Ni <kani@tableau.com>
2020-03-11 20:07:12 +01:00
Nicolas Hug d205638475
MNT Introduction of n_features_in_ attr with _validate_data mtd (#16112) 2020-02-29 09:05:11 -05:00
CastaChick ca78d75e75
DOC Fixed documents that refer to Bunch object #16438 (#16447)
* Added links to utils.Bunch and fixed format of the docstring in datasets

* Added links to utils.Bunch in sklearn.compose

* Added links to utils.Bunch in sklearn.tree

* Added links to utils.Bunch in sklearn.ensemble

* Added links to utils.Bunch in sklearn.inspection

* Added links to utils.Bunch in sklearn.pipeline

* modified docstring of Bunch

* Added links to utils.Bunch to index.rst of sklearn.datasets

* Fixed some docstrings because the lines are too long

* Fixed some points as reviewed.

* Add links and delete 'for more information...'

* Fixed indent

* Fixed forgotten points.

* Fixed some points as reviewed.
2020-02-27 10:04:04 +01:00
Nicolas Hug 9412f50c8c
ENH Fast PDP for DecisionTreeRegressor and RandomForestRegressor (#15864) 2020-02-24 18:53:55 +11:00
Sergul Aydore 78dc5974d5
TST check sample_weight shape added to common tests (#11598) 2020-02-21 10:04:09 -05:00
Jin-Hwan CHO baa4f07808
FIX _get_estimators_indices() in BaseBagging (#16437) 2020-02-20 13:23:17 +01:00
Roman Feldbauer 9b39c4c4d2
TST Fix unreachable code in tests (#16110) 2020-02-16 14:41:26 +01:00
Olivier Grisel 54c3a1fbe7
DOC More explicit warnings about impurity based feat. imp. (#16382) 2020-02-05 15:20:20 +01:00
Alexandre Batisse 0db80b90c7
FIX support of float32 read only input in trees (#16331) 2020-02-01 15:08:22 +01:00
Sunmi Yoon 4a187968ff
DOC Clarify that feature_importance_ are impurity based (#16237) 2020-02-01 13:18:11 +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
Marielle ea5e4d0f6b DOC added feature_importances_ to ExtraTreeRegressor (#16225) 2020-01-26 12:33:07 +01:00
dbauer9 b0c5a008d6 DOC improve random_state docstring in for tree-based models (#15264) 2020-01-08 16:11:24 +01:00
Guillaume Lemaitre 9408203ac4 COSMIT use np.iinfo to define the max int32 (#15960) 2019-12-24 09:41:21 +01:00
Brian Wignall 0e10b3a3cb DOC Fix typos, via a Levenshtein-style corrector (#15923) 2019-12-19 16:26:02 -08:00
Juan Carlos Alfaro Jiménez 41747f6ecd DOC Fix documentation of default values in tree classes (#15870) 2019-12-13 17:10:17 -05: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
Jérémie du Boisberranger 9e5819aa41 MNT Include all pxd files in the package (#15626)
* include all pxd files in package

* _libsvm _liblinear to pxi + add a test

* simplify stuff + use pathlib

* cln

* more cln
2019-11-26 17:37:26 +01:00
Nicholas Won b6f124c848 MAINT Improve variable order in BaseDecisionTree (#15664) 2019-11-19 12:36:20 +01:00
th0rwas 60248946bd EXA Adds example for tree.ExtraTreeRegressor (#15213) 2019-11-18 22:24:09 -06:00
Richard Payne 6488110706 DOC Docstring fix for DecisionTreeClassifier and DecisionTreeR… (#15483) 2019-11-05 23:36:57 +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
Alexandre de Siqueira f0b694d15b DOC Applying numpydoc validation to DecisionTreeClassifier (#15479) 2019-11-03 19:15:16 +01:00
Tirth Patel 3eb253866c DOC fix rst syntax error for reference in _classes.py (#15432) 2019-11-01 20:39:28 +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
Thomas J Fan 62aee0666e MNT Make modules private in neighbors (#15322)
* API Deprecated paths in deprecated_neighbors

* BUG Fixes dist metrics errors

* BUG Fixes deprecated paths

* CLN Address comments
2019-10-23 10:52:52 +02:00
Adrin Jalali 437ca0553c MNT Makes modules in tree and ensemble private (#14964) 2019-10-16 10:39:00 -04:00
Adrin Jalali 0eebade264 DOC docstring (shape= -> of shape) (#14640) 2019-10-02 20:54:32 -04:00
Rok Mihevc 5e4b2757d6 TST Adding multi-output checks to common tests (#13392) 2019-10-01 14:20:11 +02:00
Roman Yurchak af8a6e592a MAINT Use C99 functions from Cython (#15098) 2019-09-28 23:19:31 -04:00