Commit Graph

144 Commits

Author SHA1 Message Date
Jérémie du Boisberranger c6395d20e0
MNT Clean deprecation of dtype='numeric' + array of strings in check_array for 1.1 (#22589) 2022-03-22 14:50:11 -04:00
Claudio Salvatore Arcidiacono 7a9677ee09
FIX Change error message of check_X_y when y is None (#22578)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: claudio.arcidiacono <claudio.arcidiacono@ing.com>
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
2022-03-07 11:01:19 -05:00
Jérémie du Boisberranger 34f9dbf541
MNT Clean fixes and compat for old versions of our dependencies (#22642)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2022-03-02 11:32:06 +01:00
Thomas J. Fan 4ff0767087
ENH Better error message for check_scalar (#22218)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2022-02-11 16:15:30 +01:00
Thomas J. Fan 5f75acdd12
MNT Bump joblib version dependency to 1.0.0 (#22365) 2022-02-09 13:47:18 +01:00
Thomas J. Fan c0c504d105
FIX Only raise feature name warning with mixed types and strings (#22410) 2022-02-08 19:14:40 +01:00
Thomas J. Fan 9f85c9d449
TST Better info when checking for no warnings in tests (#22362) 2022-02-03 11:42:48 +01:00
mlant 1e4ac040ee
ENH added consistency checks for args of check_scalar function (#22027)
Co-authored-by: mlant <marie.lanternier@free.fr>
2022-01-25 12:04:18 -05:00
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
Thomas J. Fan bd87153741
ENH Adds float extension array support to check_array (#21278)
Co-authored-by: Olivier Grisel <olivier.grisel@gmail.com>
2021-10-28 23:06:40 +02:00
Thomas J. Fan 6f91cbebe5
FIX Do not use deprecated API in fetch_20newsgroups_vectorized (#21216)
* FIX Do not use deprecated API in fetch_20newsgroups_vectorized

* BLD [scipy-dev]

* TST Be explicit about fill value [scipy-dev]

* TST Fixes tests for fill value

* [scipy-dev] trigger nightly build

Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
2021-10-05 14:38:48 +02:00
András Simon 9c84abd771
ENH add `only_non_negative` parameter to `_check_sample_weight` (#20880)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-09-08 13:45:48 +02:00
Guillaume Lemaitre 8bf3aa58df
FIX change the meaning of include_boundaries in check_scalar (#20921)
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-09-07 19:10:56 +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
Guillaume Lemaitre bd077e30ab
MNT use check_scalar to validate scalar in AffinityPropagation (#20723)
* MNT use check_scalar to validate scalar in AffinityPropagation

* refactor

* Apply suggestions from code review

Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>

* iter

* iter

* iter

* iter

* iter

Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-08-31 12:38:41 +02:00
Adrin Jalali 3e7c04fe2c
ENH check_is_fitted calls __is_fitted__ if available (#20657) 2021-08-20 12:37:22 +02:00
Thomas J. Fan 416898b7f4
ENH Adds Column name consistency (#18010)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-08-17 14:48:21 +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 82df48934e
MNT Applies black formatting to most of the code base (#18948) 2021-06-17 14:21:09 -04:00
Jérémie du Boisberranger 536f3ccd75
MNT Allow to only validate y in _validate_data (#20227)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-06-15 17:14:19 +02:00
Thomas J. Fan 6850c04186
API Deprecates support for np.matrix in check_array (#20165)
* API Deprecates support for np.matrix in check_array

* DOC Adds whats new

* ENH Adds link to numpy.matrix
2021-06-01 23:22:47 +02:00
Olivier Grisel 1c36b49eb2
MNT avoid pandas deprecation warning in test_validation.py (#20171) 2021-05-31 14:49:14 +02:00
Chiara Marmo 40b45e6b7c
[MRG] CI Push Scipy minimum version to 1.1.0. Remove Python 3.6 from builds. (#20069)
* Push scipy min version to 1.0.0

* Update all ubuntu images to 20.04 focal.

* Add ubuntu images 18.04 bionic and scipy fron conda-forge.

* Fix conditions.

* Pin python 3.6 for ubuntu bionic.

* Change pipeline name.

* Change matrix element name.

* Keep python 3.9 from system not conda in Ubuntu 20.04.

* Remove python directive when unnecessary.

* Cleanup.

* Downgrade to python 3.6 as scipy 1.0.0 is incompatible with 3.8.

* Fix comment.

* Fix comment.

* Pin pytest again as we are forced to use 3.6.

* Move to conda installer for 32bit linux.

* Install miniconda for ubuntu 32bit.

* Install wget for ubuntu 32bit.

* Revert 32bit OS to ubuntu bionic 18.04.

* Install scipy from pip in 32bit system.

* Fix doctest failures.

* Revert example rendering.

* Relax pytest version in ubuntu install.

* Skip failing tests.

* Put comment at the right place.

* Remove python3.6. Ubuntu32 still needs to be adapted.

* Push numpy and scipy min versions for compatibility with 3.7.

* Push matplotlib min version for compatibility with 3.7. Install numpy via pip in 32bit linux.

* Install numpy before scipy in Linux 32bit.

* Pass numpy version to linux32.

* Test 32bit architecture on debian buster (still exists for 32bit with python 3.7).

* Install matplotlib from distribution.

* Syntax error...

* Stick to the numpy debian version to avoid Expected 124 from C header, got 112 from PyObject error.

* Clean comments.

* Revert skip in doctest to check with new dependencies.

* Rename distrib.

* Skip again...

* Fix test on check_array.

* Remove comment and fix lint at the same time.

* Clean import.

* Increase atol in test_derivatives to make the test pass in py37_conda_openblas environment.

* Avoid sparse matrix dependent on scipy version.

* Skip docstring test for pandas versions less then 1.1.0.

* Fix lint error.

* Empty commit to force checks.

* Add minimal dependencies in changelog.

* Update to python 3.7 CircleCI and Travis builds.

* Move to debian buster for python3.7 dependencies.

* Fix the container tag.

* Lower the minimal pandas version for compatibility with python 3.7.
2021-05-18 16:09:36 +02:00
Thomas J. Fan 80f923e00d
ENH num_features for a 1d collection of dicts is undefined (#19740)
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
2021-03-29 16:12:54 +02:00
Thomas J. Fan d996eaf088
ENH Adds _num_features for array-likes (#19633)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
2021-03-16 15:14:25 +01:00
Thomas J. Fan 38e6022e24
TST Ignores PendingDeprecationWarning in tests (#19301) 2021-01-30 13:35:07 +01: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
Thomas J. Fan f82525ee2f
CLN Deprecations position args in PartialDependenceDisplay.plot (#18293) 2020-11-27 12:34:55 +01:00
Thomas J. Fan b197cc04e5
MNT Correctly errors in check_array with dtype=numeric and string/bytes (#18496)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2020-11-18 18:18:31 +01:00
alexshacked 138dd7b88f
FIX be more permissive with using subtype in test_check_pandas_sparse_valid (#18277) 2020-08-27 17:17:57 +02:00
alexshacked 0111511ea3
FIX Raise proper error for sparse dataframe with mixed dtypes (#17992)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2020-08-25 13:54:05 -04:00
Christian Kastner 5af6561441
TST Change expected result type np.int64 -> np.int (#18089)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2020-08-07 08:46:53 +02:00
Juan Carlos Alfaro Jiménez 547ead6c0c
MNT More replacements of numpy aliases with built-in types (#17707)
* MNT More replacements of numpy aliases with built-in types [scipy-dev]

* MNT More (manual) replacements of numpy aliases

* MNT More (manual) replacements of numpy aliases

* FIX Minor change

* MNT Trigger build [scipy-dev]

* FIX Minor change

* MNT Trigger build [scipy-dev]

* FIX More deprecations of numpy aliases [scipy-dev]

* MNT Silent numpy aliases warnings [scipy-dev]

* FIX Fix silent deprecations

* Trigger build [scipy-dev]

* FIX Add scape characters [scipy-dev]

* FIX Remove package specification from silent

* Trigger build [scipy-dev]

* Revert
2020-06-26 12:45:03 +02: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
Thomas J Fan acbe13c07d
ENH Adds pandas IntegerArray support to check_array (#16508) 2020-04-28 19:00:12 +02:00
Nicolas Hug 76ef8b0ef0
API kwonly for utils (#17046)
* kwonly for utils

* More

* fixed some

* some more

* iwannagohomepls

* accept_sparse not kwonly anymore
2020-04-27 15:42:01 +02:00
Roman Yurchak f621d8a392
Revert "API kwonly for utils (#17007)" (#17045) 2020-04-26 18:30:09 +02:00
Nicolas Hug 81c1e9d1f2
API kwonly for utils (#17007) 2020-04-26 18:05:16 +02:00
Thomas J Fan 9901d8df13
Fix _deprecate_positional_args for kwonly args w/o default (#16850) 2020-04-14 09:38:32 -04:00
Thomas J Fan fa1ea2ab6f
ENH Adds support for pandas dataframe with only sparse arrays (#16728) 2020-03-27 12:09:23 +01:00
Roman Feldbauer 9b39c4c4d2
TST Fix unreachable code in tests (#16110) 2020-02-16 14:41:26 +01:00
Alexandre Batisse 418e0d55d3
[MRG] CLN Remove the use of assert_raises in utils/ (#16337)
* CLN use pytest raises ctxt manager for class weights & estimators [skip ci]

* CLN use pytest raises ctxt manager for multiclass test

* CLN use pytest warns in estimator checks test

* CLN use pytest raises ctxt manager for random test

* CLN use pytest raises ctxt manager for sparsefuncs test

* CLN use pytest raises ctxt manager for testing utils tests

* CLN use pytest raises ctxt manager for utils tests

* CLN use pytest raises ctxt manager for validation tests

* revert test_estimator_check.py to upstream master
2020-02-02 14:44:19 +01:00
Adrin Jalali 46001e7cfb FIX support scalar values in fit_params in SearchCV (#15863)
* support a scalar fit param

* pep8

* TST add test for desired behavior

* FIX introduce _check_fit_params to validate parameters

* DOC update whats new

* TST tests both grid-search and randomize-search

* PEP8

* DOC revert unecessary change

* TST add test for _check_fit_params

* olivier comments

* TST fixes

* DOC whats new

* DOC whats new

* TST revert type of error

* add olivier suggestions

* address olivier comments

* address thomas comments

* PEP8

* comments olivier

* TST fix test by passing X

* avoid to call twice tocsr

* add case column/row sparse in check_fit_param

* provide optional indices

* TST check content when indexing params

* PEP8

* TST update tests to check identity

* stupid fix

* use a distribution in RandomizedSearchCV

* MNT add lightgbm to one of the CI build

* move to another build

* do not install dependencies lightgbm

* MNT comments on the CI setup

* address some comments

* Test fit_params compat without dependency on lightgbm

Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2019-12-31 13:02:45 +01:00
Thomas J Fan 9accce5519 BUG Adds attributes back to check_is_fitted (#15947)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2019-12-27 11:46:27 +01:00
Nicolas Hug 4256542b10 MNT Removed deprecated attributes and parameters (#15803) 2019-12-09 22:17:06 +08:00
Thomas J Fan 1b1c869ef3 BUG Fixes pandas dataframe bug with boolean dtypes (#15797) 2019-12-06 13:54:12 +01:00
smarie 343214085a ENH KernelPCA raises error in case of numerical/conditioning issues (#12145) 2019-11-14 12:29:23 -05:00
Nicolas Hug 12c2b40761
MNT Remaining deprecations in sklearn/file.py (#15399) 2019-11-04 14:22:42 -05: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