Commit Graph

168 Commits

Author SHA1 Message Date
Guillaume Lemaitre e7ae63f784
FIX avoid unecessary `if copy` branch for sparse array/matrix (#27336)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2023-09-11 13:58:14 +00:00
Loïc Estève 1821c3c855
CI Fix scipy-dev issues related to numpy 2.0 changes (#27190) 2023-08-29 13:04:33 +02:00
Omar Salman 02d20c1851
ENH Add routing to LogisticRegressionCV (#26525)
Co-authored-by: Omar Salman <omar.salman@arbisoft>
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2023-07-14 19:00:35 +02:00
Thomas J. Fan 0e1f170d8a
ENH Adds feature names support to dataframe protocol (#26464)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2023-06-21 23:45:55 +00:00
Adrin Jalali 42173fdb34
MNT add isort to ruff's rules (#26649) 2023-06-21 17:50:07 +02:00
Jérémie du Boisberranger 9c266cf5d6
MAINT Param validation: decorate all estimators with _fit_context (#26473) 2023-06-14 16:52:35 +02:00
Thomas J. Fan 66a3905541
ENH Adds PyTorch support to LinearDiscriminantAnalysis (#25956)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Tim Head <betatim@gmail.com>
2023-04-21 11:13:29 +02:00
Julien Jerphanion 545cc809e1
MAINT Extend message for large sparse matrices support (#25961)
Co-authored-by: Meekail Zain <34613774+Micky774@users.noreply.github.com>
2023-03-25 19:25:47 +00:00
Guillaume Lemaitre 01b9050b69
MAINT introduce _get_response_values and _check_response_methods (#23073)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
2023-03-24 18:15:08 +01:00
Thomas J. Fan 18af550801
FIX Fixes pandas extension arrays with objects in check_array (#25814) 2023-03-22 19:31:29 +01:00
Thomas J. Fan 65dfab01cd
FIX Fixes pandas extension arrays in check_array (#25813) 2023-03-22 17:41:32 +01:00
Thomas J. Fan 245ac79641
FIX Fixes check_array nonfinite checks with ArrayAPI specification (#25619)
* FIX Fixes check_array nonfinite checks with ArrayAPI specification

* DOC Adds PR number

* FIX Test on both cupy and numpy
2023-02-19 17:39:34 +01:00
Tim Head a576bcc22f
FIX Convert boolean pd.Series to boolean ndarrays (#25147) 2022-12-12 11:41:13 +01:00
Thomas J. Fan 54d91d3cbe
FIX Fixes check_array for pd.NA in a series (#25080) 2022-12-02 12:45:31 +01:00
Thomas J. Fan f1963445fc
ENH Improves error message for mixed types for feature names (#25018)
Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr>
2022-11-25 14:58:58 +01:00
Olivier Grisel 6f6871e4fe
MAINT test against intp instead of int0 (#25037) 2022-11-25 11:27:18 +01:00
Jérémie du Boisberranger 9f9f1684e9
MAINT Clean deprecation for 1.2: validation (#24493)
* cln deprecations

* cln

* fix tst switch to pytest.raises
2022-09-22 13:46:31 -04:00
Meekail Zain 1a3cbd004a
MNT Make error catching more explicit in tests (#23829) 2022-07-04 16:35:59 -04:00
Guillaume Lemaitre ac8dd1dca5
MAINT make explicit casting when using iloc (#23649) 2022-06-22 11:04:49 +02:00
Meekail Zain 47f3c37c1c
MNT Removed object dtype validation in `check_array` for scipy nightly (#23641)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
2022-06-16 12:40:35 +02:00
Thomas J. Fan 35d5b97ff0
MNT Removes pytest.warns(None) in test_validation (#23282) 2022-05-12 11:28:53 +02:00
Maxwell d3050e4605
DOC List estimators that supports missing data in user guide (#23198)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Lise <lise.kleiber@insa-rouen.fr>
Co-authored-by: Chiara Marmo <marmochiaskl@gmail.com>
2022-05-04 14:49:00 -04:00
Thomas J. Fan 8d7935827d
ENH check_array returns numeric array w/ mixed typed dataframes (#22237)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2022-04-24 09:02:56 -04:00
adamgonzo 1836b877c0
TST remove pytest.warns(None) in utils/tests/test_validation.py (#23029) 2022-04-04 16:44:11 +02:00
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