Commit Graph

63 Commits

Author SHA1 Message Date
Adrin Jalali 5080f2527c
CLN remove unneeded copyrights (#29257) 2024-06-17 11:11:33 +02:00
Adrin Jalali 55ca335e42
CLN use new license notice line (#29246) 2024-06-13 15:51:09 +02:00
Loïc Estève abbaed326c
MAINT Drop official PyPy support (#29128) 2024-06-03 14:30:35 +02:00
Jérémie du Boisberranger cd1b1bef0e
MAINT cleanup utils.__init__: move IS_PYPY, _IS_WASM, _IS_32BIT into utils.fixes (#28768)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2024-04-08 09:07:26 +00:00
Ralf Gommers 5efc66740c
MAINT: convert `numpy.array_api` to array-api-strict (#28555)
Co-authored-by: adrinjalali <adrin.jalali@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Tim Head <betatim@gmail.com>
2024-03-18 17:27:09 +00:00
Yao Xiao de7a43fa3c
FIX safe indexing for polars `Series` (#28521)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2024-03-06 15:45:48 +01:00
Stefanie Senger 981488412b
TST separate checks for sparse array and sparse matrix input in `estimator_checks` (#27576)
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
2024-02-23 14:45:33 +01:00
Jérémie du Boisberranger 1d293245ec
MAINT cleanup utils.__init__: move openblas check into fixes (#28486)
Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
2024-02-22 10:00:24 +01:00
Loïc Estève 50e8749108
CI Use Python 3.12 in scipy-dev (#28383) 2024-02-14 17:35:52 -05:00
Loïc Estève ad3addd37f
CI Use environment variable to turn warnings into errors in tests and doc build (#28372)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2024-02-08 18:54:36 +01:00
Guillaume Lemaitre 69cef4adc1
FIX _convert_container should be able to convert from sparse to sparse (#28185)
Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
2024-01-22 09:53:04 +00:00
Loïc Estève 55c6679ada
TST Tweak tests to facilitate Meson usage (#28094)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2024-01-12 14:44:41 +00:00
Loïc Estève b5827cbf7a
CI Fix scipy-dev build (#28047) 2024-01-04 14:28:45 +01:00
Franck Charras 3cd80629cf
MNT Prune unused argument in `_array_api_for_tests` util (#27941) 2023-12-11 16:43:48 -05:00
Jérôme Dockès e1ce967a33
ENH detect categorical polars columns in HistGradientBoosting (#27835)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2023-12-05 10:15:06 +01:00
Guillaume Lemaitre 9290bae93c
FIX force explicitely the orientation when creating polar DataFrame (#27854) 2023-11-27 11:40:12 +01:00
Olivier Grisel 1f1329f7ec
FIX Use torch.backends.mps.is_built() instead of torch.has_mps (#27642) 2023-10-23 19:14:43 +02:00
Olivier Grisel c6d0d29b19
FIX update create_memmap_backed_data to work on any estimator object via joblib 1.2.0 and later (#27614) 2023-10-22 19:54:01 +02:00
Tim Head b470ba1bd5
FIX CUDA detection when using PyTorch (#27606) 2023-10-17 18:48:26 +02:00
Olivier Grisel 4eabb0ec14
MAINT hide numpy warning when using _array_api_for_tests (#27384)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
2023-09-15 22:38:47 +02:00
Yao Xiao 7dd3e4e21c
TST Extend tests for `scipy.sparse/*array` in `sklearn/utils/tests/test_testing` (#27276) 2023-09-12 18:40:23 +02:00
Tim Head b7d80a0317
FIX skip array API tests when running with device="mps" without the PYTORCH_ENABLE_MPS_FALLBACK env var (#27199)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2023-09-07 12:23:35 -04:00
Edoardo Abati 844b087da4
ENH Add Array API compatibility to `zero_one_loss` and `accuracy_score` (#27137) 2023-09-07 16:03:15 +02:00
Thomas J. Fan fcaf0ff047
MNT Use assert_no_warnings from numpy.testing (#27031) 2023-08-09 16:30:46 +00:00
Mateusz Sokół 62b9e4a6db
ENH: Update numpy exceptions imports (#27013) 2023-08-08 08:42:48 +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
Dimitri Papadopoulos Orfanos 4509e5810b
CLN EnvironmentError, IOError, WindowsError → OSError (#26466) 2023-06-02 17:20:31 -04:00
Thomas J. Fan ae78c25b00
MNT Use copy=False when creating DataFrames (#26272) 2023-04-25 12:00:03 +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
Olivier Grisel 7917117eda
MAINT Remove travis ci config and related doc (#25562) 2023-02-08 10:00:35 +01:00
Jérémie du Boisberranger b79423ea3e
MAINT Clean deprecation for 1.2: assert_warns (#24442) 2022-09-15 16:36:50 +02:00
Loïc Estève 79c21c57aa
TST Make sure memmap are aligned when OpenBLAS detects Prescott architecture (#23994) 2022-07-26 10:38:01 -04:00
Vicente Reyes-Puerta 4fa77dd5b4
MAINT Update to mypy 0.961 to ensure compatibility with python 3.10 (#23729) 2022-06-23 15:20:27 +02:00
Malte S. Kurz 996237f01f
DOC fix assert_allclose docstring: atol is not being set based on the provided arrays' dtypes (#23555) 2022-06-07 15:11:22 +02:00
Julien Jerphanion 613773db11
TST Add minimal setup to be able to run test suite on float32 (#22690)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com>
2022-03-17 14:25:17 +01:00
Julien Jerphanion 6a16763c00
ENH Introduce `PairwiseDistancesReduction` and `PairwiseDistancesArgKmin` (feature branch) (#22134)
* MAINT Introduce Pairwise Distances Reductions private submodule  (#22064)

* MAINT Introduce FastEuclideanPairwiseArgKmin  (#22065)

* fixup! Merge branch 'main' into pairwise-distances-argkmin

Remove duplicated Bunch

* MAINT Plug `PairwiseDistancesArgKmin` as a back-end (#22288)

* Forward pairwise_dist_chunk_size in the configuration

* Flip finalized results for PairwiseDistancesArgKmin

The previous would have made the code more complex
by introducing some boilerplate for the interface plugs.

Having it this way actually simplifies the code.

This also removes the haversine branch for
test_pairwise_distances_argkmin

* Plug PairwiseDistancesArgKmin as a back-end

* Adapt test accordingly

* Add whats_new entry

* Change input validation order for kneighbors

* Remove duplicated test_neighbors_distance_metric_deprecation

* Adapt the documentation

* Add mahalanobis case to test fixtures

* Correct whats_new entry

* CLN Remove unneeded private metric attribute

This was needed when 'fast_sqeuclidean' and 'fast_euclidean'
were present to choose the best implementation based on the user
specification.

Those metric have been removed since then, making this attribute
useless.

* TST Assert FutureWarning instead of DeprecationWarning in
test_neighbors_metrics

* MAINT Add use_pairwise_dist_activate to scikit-learn config

* TST Add a test for the 'brute' backends' results' consistency

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

* fixup! MAINT Add use_pairwise_dist_activate to scikit-learn config

* fixup! fixup! MAINT Add use_pairwise_dist_activate to scikit-learn config

* TST Filter FutureWarning for WMinkowskiDistance

* MAINT pin numpydoc in arm for now (#22292)

* fixup! TST Filter FutureWarning for WMinkowskiDistance

* Revert keywords arguments removal for the GEMM trick for 'euclidean'

* MAINT pin max numpydoc for now (#22286)

* Add 'haversine' to CDIST_PAIRWISE_DISTANCES_REDUCTION_COMMON_METRICS

* fixup! Add 'haversine' to CDIST_PAIRWISE_DISTANCES_REDUCTION_COMMON_METRICS

* Apply suggestions from code review

* MAINT Document some config parameters for maintenance

Also rename one of them.

* FIX Support and test one of 'sqeuclidean' specification

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

* FIX Various typos fix and correct haversine

'haversine' is not supported by cdist.

* Directly use get_config

* CLN Apply comments from review

* Motivate swapped returned values

* TST Remove mahalanobis from test fixtures

* MNT Add comment regaduction functions' signatures

* TST Complete test for `pairwise_distance_{argmin,argmin_min}` (#22371)

* DOC Add sub-pull requests to the whats_new entry

* DOC place comment inside functions

* DOC move up whatsnew entry

Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com>
2022-02-17 10:37:22 +01:00
Thomas J. Fan 30c89280ce
MAINT Adjust tests for numpydoc 1.2 (#22287)
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2022-02-11 17:11:50 +01:00
Christian Lorentzen 3f717cc48a
[MRG] FIX segmentation fault on memory mapped contiguous memoryview (#21654) 2021-11-18 14:55:48 +01:00
Thomas J. Fan d1285a9232
DOC Adds missing imports into examples and test them (#21186) 2021-09-29 13:51:33 +02:00
Olivier Grisel 504682172b
MAINT deprecate assert_warns and assert_warns_messsage (#20521)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-07-20 15:01:16 +02:00
Thomas J. Fan 3ae7c76153
STY Enables black with experimental_string_processing=true (#20412) 2021-06-29 09:47:04 +02:00
Juan Martin Loyola 617ff6ef72
MAINT Remove unused variables indicated by lgtm.com (#20303) 2021-06-19 10:24:10 +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
Conner Shen 64bafa313e
FIX mcc zero divsion (#19977) 2021-06-03 12:15:30 +02:00
Andrew Delong a67b284f90
FIX Encoder should accept categories having dtype='S' (#19727)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-04-21 17:34:28 -04:00
Guillaume Lemaitre 255718b4ad
introduce _safe_tags for estimator not inheriting from BaseEstimator (#18797)
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2020-12-02 11:18:53 +01: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
Nicolas Hug 5721629fd3
MNT Use a pytest-like context manager in estimator_checks.py (#18418) 2020-09-28 15:05:43 -04:00
N. Haiat 0573aa1a3e
DOC Fix documentation of default values in sklearn.utils._testing.py (#18386)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2020-09-23 13:16:58 +02:00