Commit Graph

64 Commits

Author SHA1 Message Date
Olivier Grisel 2571cb2989
Improve validation messages with infinite data (#21219)
* Improve validation messages with infinite data

* Extend and fix validation tests

* Test and fix extended error message

* data_name => input_name

* Mention estimators that natively support missing values

* More informative error message

* cosmetic

* typo

* Fix broken tests

* Fix test_knn

* Add changelog entry

* Fix broken test for param search models

* Missing input names

* Allow Y and y in estimator checks

* Add missing input names

* Fix input_name for FunctionTransformer

* More missing input names

* Update test

* More test fixes on scores

* Simplify message to avoid to make generic fallback meaningful

Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>

* More informative estimator checks failure messages

* Make sure the estimator name is passed correctly in _validate_data

* Simplify calls to _validate_data

* Handle estimator name in private _check_y helper

* More specific error message

* Add estimator to check_X_params and check_y_params

* Add .. versionadded flags in public docstrings

* Update changelog

* Improve _validate_data's docstring

* Typo in doc/whats_new/v1.1.rst

* Make _check_estimator_name return None if estimator == None

Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>

* check_params dict updates with style

* Increase test coverage

Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2021-10-29 15:59:57 +02:00
Juan Martin Loyola 6e2388f901
DOC Ensures that RobustScaler passes numpydoc validation (#21155) 2021-09-27 10:34:03 +02:00
Dimitri Papadopoulos Orfanos f71c031314
DOC Typos found by codespell (#21069) 2021-09-17 19:04:54 +02:00
Manimaran 21fdba3bc9
DOC Ensures that QuantileTransformer passes numpydoc validation (#21065) 2021-09-16 14:00:34 +02:00
Juan Martin Loyola 8023efe0c0
DOC Ensures that Normalizer passes numpydoc validation (#21061) 2021-09-16 10:01:03 +02:00
Juan Martin Loyola 597df0ad17
DOC Ensures that PowerTransformer passes numpydoc validation (#21015)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-09-13 17:46:52 +02:00
Thomas J. Fan 4abd9f2d9e
API Implements get_feature_names_out for transformers that support get_feature_names (#18444)
Co-authored-by: Andreas Mueller <andreas.mueller@columbia.edu>
Co-authored-by: Andreas Mueller <andreasmuellerml@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Olivier Grisel <olivier.grisel@gmail.com>
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
2021-09-07 10:56:57 +02:00
Christian Lorentzen c90fae02c2
CLN some code cleansing in preprocessing (#18686) 2021-08-31 18:58:56 +02:00
Thomas J. Fan 786c4e5e39
DOC Adds feature_names_in_ to docstrings (#20787) 2021-08-26 13:44:45 +02:00
genvalen 84c30ce432
DOC Ensures that KernelCenterer passes numpydoc validation (#20698) 2021-08-07 19:35:01 +02:00
Maxwell 238451d55e
FIX StandardScaler.inverse_transform raise error when the input is a 1d array (#19752)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-07-23 20:44:52 +02:00
Glòria Macià Muñoz 59658989d7
DOC Ensures MaxAbsScaler passes numpydoc validation (#20455) 2021-07-06 12:30:45 +02:00
genvalen c79bed337c
DOC Ensures that Binarizer passes numpydoc validation (#20422)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-06-30 10:03:23 +02:00
Thomas J. Fan 3ae7c76153
STY Enables black with experimental_string_processing=true (#20412) 2021-06-29 09:47:04 +02:00
Thomas J. Fan 383b53fa91
FIX Uses code literals in deprecated to prevent linking (#20410)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-06-28 15:49:19 +02:00
Nicolas Miller 70056ef837
DOC Ensures that MinMaxScaler passes numpydoc validation (#20391) 2021-06-28 10:31:36 +02:00
Nicolas Miller 6a562337f9
DOC Fixes numpydoc validation errors in StandardScalar (#20368) 2021-06-26 13:46:25 -04:00
Thomas J. Fan 351ace7935
STY Uses black's with target_version >= 3.7 (#20294) 2021-06-17 15:50:27 -04:00
Thomas J. Fan 82df48934e
MNT Applies black formatting to most of the code base (#18948) 2021-06-17 14:21:09 -04:00
Thomas J. Fan 9a13bdfaf1
MNT Adds black config and fixes formatting before black (#19031)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
2021-06-12 17:14:09 +02:00
Guillaume Lemaitre 1cd282d600
DOC add n_features_in_ in the documentation (#20236) 2021-06-09 16:58:03 +02:00
Tom Dupré la Tour f6e6ad2d9e
MNT clean futurewarning for 1.0 | _deprecate_positional_args (#20002)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2021-05-14 11:30:27 -04:00
Guillaume Lemaitre 6a562d31e4
ENH improve KernelCenterer documentation and tests (#19901)
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Sylvain Marié <sylvain.marie@schneider-electric.com>
2021-04-27 17:45:20 +02:00
Jérémie du Boisberranger 684b7d1955
FIX detect near constant feature in StandardScaler and linear models (#19788)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-04-14 13:34:22 +02:00
makoeppel df3f1bda42
FIX Adds check_array to inverse_transform of StandardScaler (#19356)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2021-03-23 09:14:41 -04:00
Avi Gupta ca9618c0e2
MNT move PolynomialFeatures from _data.py to _polynomial.py (#19611)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2021-03-18 14:58:51 +01:00
Olivier Grisel c748e465c7
FIX Don't scale near-constant features to large values (#19527) 2021-02-25 10:21:52 +01:00
Thomas J. Fan 95fa18f278
TST Fixes docstring ordering and test_docstring_parameters (#19048) 2021-02-12 11:35:05 +01:00
Norbert Preining 8066086a85
MNT Consolidate _incremental_weighted_mean_and_var into _incremental_mean_and_var (#19422) 2021-02-10 16:37:14 +01:00
Christian Lorentzen 27f1c737f2
FEA Add SplineTransformer (#18368) 2021-01-24 10:53:27 +01:00
Kunj 1e46db6693
DOC Update docs for StandardScaler.scale_ to include 0 variance (#19124)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2021-01-09 12:47:13 -05:00
Guillaume Lemaitre 2218ec4622
MNT change 0.25 to 1.0 and 0.26 to 1.1 in deprecation messages (#19005)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2020-12-18 16:09:19 +00:00
Alexandre Gramfort 5263eea04d
ENH add support for sample_weights in StandardScaler when X is sparse (#18682) 2020-10-28 09:34:17 +01:00
Thomas J. Fan d933c20bef
ENH Checks n_features_in_ in preprocessing module (#18577)
Co-authored-by: Olivier Grisel <olivier.grisel@gmail.com>
Co-authored-by: Joel Nothman <joel.nothman@gmail.com>
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2020-10-21 18:11:44 +02:00
Thomas J. Fan 02fa8f1adb
ENH Deprecates _pairwise attribute and adds pairwise to estimator tags (#18143) 2020-10-07 21:53:36 +11:00
Maria Telenczuk 64697c665f
MRG Sample weight for StandardScaler (#18510) 2020-10-07 10:10:30 +02:00
Guillaume Lemaitre 21569e719c
TST Common test preserve dtype (#18054)
Co-authored-by: Sebastian Kießling <sebkies@gmail.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2020-09-08 10:13:53 +02:00
Albert Villanova del Moral 647fcb1ac1
DOC Fix A to uppercase in See Also docstring section (#18332) 2020-09-04 10:35:01 -04:00
Albert Villanova del Moral 875d32fe55
DOC Fix versionadded/versionchanged for 0.24 (#18312) 2020-09-01 10:51:01 +02:00
Frans Larsson 39ad4245fd
DOC fix docstring in preprocessing module following doc guideline (#18239) 2020-08-23 09:53:19 +02:00
Yashika Sharma 3017ea8c30
ENH Added parameter clip to MinMaxScaler (#17833) 2020-07-10 22:50:30 +02:00
Saurabh Jain 00bc681e10
DOC shorten class links in docstring using tilde (#17470)
* added tilde to bunch of files

* Updated _kde.py

Changed array_like to array-like

* Updated _kde.py

Removed space

* updated _kde.py

Added full stop

* PEP8

Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2020-06-16 10:44:13 +02:00
Neil Botelho 9fa140406a
DOC add warning note regarding data leakage by using quantile_transform (#17581) 2020-06-15 11:32:28 +02:00
Cat Chenal f9966ba61c
DOC add warning note regarding data leakage by using scale and robust_scale (#17558) 2020-06-15 10:30:49 +02:00
George Kiragu ddb094a07e
DOC add warning to power transform on data leakage(#17535)
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
2020-06-09 13:32:23 +02:00
CeeThinwa 728b413990
DOC added a warning to minmax_scale #dataumbrella (#17507) 2020-06-08 18:47:50 -04:00
Krum Arnaudov 715e240968
DOC added a warning to maxabs_scale to prevent data leakage (#17487)
* added a warning to maxabs_scale

* Update sklearn/preprocessing/_data.py

Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>

Co-authored-by: Krum Arnaudov <krum.arnaudov@amplifyanalytix.com>
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
2020-06-06 16:52:06 -04:00
Lucy Liu 863e58fcd5
ENH Add option to scale output to unit var in RobustScaler (#17193)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2020-06-02 14:50:27 +02:00
Alessandro Gentile ffd1873dca
DOC improve supporting types input and output in preprocessing module (#16656) 2020-05-27 15:17:15 +02:00
Lucy Liu bb4b097fa9
DOC Fix typo in quantile_transformer (#17343) 2020-05-25 14:33:11 -04:00