Commit Graph

1839 Commits

Author SHA1 Message Date
Thomas J. Fan d4aad64b1e
MNT Update to black 22.3.0 to resolve click error (#22983)
* MNT Update to black 22.3.0 to resolve click error

* STY Update for new black version
2022-03-29 12:04:41 +02:00
Daniela Fernandes 8fb8b444ce
TST Replace pytest.warns(None) in utils/tests/test_utils.py (#22961) 2022-03-27 13:47:13 +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
cdrig ac4cc3c64e
DOC make min_max_axis pass numpydoc (#22839)
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
2022-03-22 02:07:51 +01:00
Jérémie du Boisberranger bb5ab53f94
API Config: change default display to "diagram" (#22856) 2022-03-21 15:43:07 +01:00
Dimitri Papadopoulos Orfanos ee5a1b69d1
DOC, MNT Typos found by codespell (#22906) 2022-03-20 19:16:39 +01:00
Thomas J. Fan 7116165f49
ENH Adds better error message for GitHub in html repr (#22902) 2022-03-20 09:03:24 +11:00
Christian Lorentzen 99262c06c0
MNT remove sparse_lsqr from utils.fixes (#22894) 2022-03-18 21:14:07 +01:00
Julien Jerphanion 0b2f4ead15
MAINT Create a private extension for sorting utilities (#22760) 2022-03-17 18:48:03 -04:00
Jérémie du Boisberranger b9bd2d524d
API Deprecate if_delegate_has_method (#22830) 2022-03-17 13:16:53 -04: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
Thomas J. Fan 6511ef046f
FIX Fixes visualization for nested meta-estimators (#21310)
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
2022-03-14 18:22:59 +01:00
Thomas J. Fan 7f0006c8aa
ENH Adds infrequent categories to OneHotEncoder (#16018)
* ENH Completely adds infrequent categories

* STY Linting

* STY Linting

* DOC Improves wording

* DOC Lint

* BUG Fixes

* CLN Address comments

* CLN Address comments

* DOC Uses math to description float min_frequency

* DOC Adds comment regarding drop

* BUG Fixes method name

* DOC Clearer docstring

* TST Adds more tests

* FIX Fixes mege

* CLN More pythonic

* CLN Address comments

* STY Flake8

* CLN Address comments

* DOC Fix

* MRG

* WIP

* ENH Address comments

* STY Fix

* ENH Use functiion call instead of property

* ENH Adds counts feature

* CLN Rename variables

* DOC More details

* CLN Remove unneeded line

* CLN Less lines is less complicated

* CLN Less diffs

* CLN Improves readiabilty

* BUG Fix

* CLN Address comments

* TST Fix

* CLN Address comments

* CLN Address comments

* CLN Move docstring to userguide

* DOC Better wrapping

* TST Adds test to handle_unknown='error'

* ENH Spelling error in docstring

* BUG Fixes counter with nan values

* BUG Removes unneeded test

* BUG Fixes issue

* ENH Sync with main

* DOC Correct settings

* DOC Adds docstring

* DOC Immprove user guide

* DOC Move to 1.0

* DOC Update docs

* TST Remove test

* DOC Update docstring

* STY Linting

* DOC Address comments

* ENH Neater code

* DOC Update explaination for auto

* Update sklearn/preprocessing/_encoders.py

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

* TST Uses docstring instead of comments

* TST Remove call to fit

* TST Spelling error

* ENH Adds support for drop + infrequent categories

* ENH Adds infrequent_if_exist option

* DOC Address comments for user guide

* DOC Address comments for whats_new

* DOC Update docstring based on comments

* CLN Update test with suggestions

* ENH Adds computed property infrequent_categories_

* DOC Adds where the infrequent column is located

* TST Adds more test for infrequent_categories_

* DOC Adds docstring for _compute_drop_idx

* CLN Moves _convert_to_infrequent_idx into its own method

* TST Increases test coverage

* TST Adds failing test

* CLN Careful consideration of dropped and inverse_transform

* STY Linting

* DOC Adds docstrinb about dropping infrequent

* DOC Uses only

* DOC Numpydoc

* TST Includes test for get_feature_names_out

* DOC Move whats new

* DOC Address docstring comments

* DOC Docstring changes

* TST Better comments

* TST Adds check for handle_unknown='ignore' for infrequent

* CLN Make _infrequent_indices private

* CLN Change min_frequency default to None

* DOC Adds comments

* ENH adds support for max_categories=1

* ENH Describe lexicon ordering for ties

* DOC Better docstring

* STY Fix

* CLN Error when explicity dropping an infrequent category

* STY Grammar

Co-authored-by: Joel Nothman <joel.nothman@gmail.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2022-03-14 15:48:18 +01:00
sakinaOuisrani f9d74236e2
fix docstring of dict_learning.sparse_encode and multiclass.check_classification_targets #21350 #pariswimlds (#22793)
* fix docstring

* fixed linting in multiclass

* fixed linting in dict learning

* fixed linting in dict learning

* fixed linting in dict learning

* fixed linting in dict learning

* fixed linting in dict learning

Co-authored-by: Sakina <s.ouisrani@sesamm.com>
2022-03-12 18:41:19 +01:00
Vera Komeyer 34dd69bc15
DOC Ensures that check_random_state passes numpydoc validation (#22787) 2022-03-12 17:27:57 +01:00
iofall ff1c6f3a92
FIX Remove validation from __init__ and set_params for ColumnTransformer (#22537)
Co-authored-by: iofall <50991099+iofall@users.noreply.github.com>
Co-authored-by: arisayosh <15692997+arisayosh@users.noreply.github.com>
2022-03-09 11:56:06 +01:00
Thomas J. Fan ce7bb4c06b
CLN Removes unused fused type (#22727) 2022-03-08 11:27:38 +01:00
Olivier Grisel 279388d9ed
DOC Improve get_feature_names_out docstrings (#22718)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2022-03-07 13:02:12 -05: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
Thomas J. Fan 3605c140af
FIX Support extra class_weights in compute_class_weight (#22595) 2022-03-07 10:31:25 +01:00
Thomas J. Fan 269bdb9489
MAINT Bump versions to match oldest-supported-numpy (#22674) 2022-03-04 18:51:39 +01:00
Jérémie du Boisberranger 33e4843e88
MNT remaining clean up for 1.1 (#22643) 2022-03-02 14:01:51 +01: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
Olivier Grisel a2edddaf67
MAINT pypy compat for sklearn.show_versions (#22649)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2022-03-02 10:10:22 +01:00
Olivier Grisel 817f069599
FIX Avoid side effects importing pip/setuptool in show_version (#22621)
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
2022-02-28 16:28:04 -05:00
Thomas J. Fan f1d3417b08
MNT Drops Python 3.7 in CI, wheel building, and docs (#22617)
* MNT Drops Python 3.7

* MNT Bump NumPy and SciPy

* FIX Fix build

* FIX Bump versions improved

* DOC Fixes numpy version [pypy]

* BLD [pypy] [icc-build]

* Update docs

* MAINT use scipy.optimize.LinearConstraint in test

* MAINT scipy 1.1.0 related code clean-up

* scipy>=1.3.2 in pyproject.toml's build deps

* [cd build]

* DOC Adds comment about pypy

* MAINT remove _astype_copy_false

* FIX Update check for python version in setup.py

Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2022-02-28 18:23:02 +01:00
Sam Adam Day 26d218cfeb
DOC Ensures that get_chunk_n_rows passes numpydoc validation (#22539) 2022-02-18 15:25:55 -05:00
Guillermo Tomás Fernández Martín 8abc6d890e
DOC Ensure that tosequence passes numpydoc validation (#22494)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2022-02-17 17:17:28 +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 5d1571db5c
FIX Supports numpy strings and array-like in KMean.init (#22154)
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
2022-02-15 17:35:40 +01:00
Thomas J. Fan 1fc86b6aac
MNT Update black to stable version (#22474) 2022-02-15 11:36:26 +01:00
Maxwell 648d18f16a
FIX skip tests when estimator has non_deterministic tag (#22318) 2022-02-14 23:17:03 -05:00
Ugo Marchand 9712e80bbc
DOC Ensures that assert_all_finite passes numpydoc validation (#22470)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2022-02-14 10:45:07 +01:00
mathurinm e86644a324
API Lowercase estimator argument in check_estimator() (#22188)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2022-02-14 10:40:51 +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
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
Guillaume Lemaitre 229bd226ab
MNT remove _pairwise attribute (#21594) 2022-02-09 16:58:01 +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 d7feac0ccf
ENH Adds feature_names_out to preprocessing module (#21079)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: 赵丰 (Zhao Feng) <616545598@qq.com>
Co-authored-by: Niket Jain <51831161+nikJ13@users.noreply.github.com>
Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
2022-02-07 12:09:57 +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
Meekail Zain 9f96d42e39
ENH Replaced RandomState.rand with equivalent uniform (#22327) 2022-02-01 17:09:38 -05:00
Meekail Zain 254ea8c453
ENH Replaced RandomState with Generator compatible calls (#22271) 2022-01-28 15:49:34 -05:00
Sultan Orazbayev cd892f9688
DOC use the arxiv directive in the docstrings (#21418)
Co-authored-by: aufarkari <aufar.di.sini@gmail.com>
Co-authored-by: Chiara Marmo <cmarmo@users.noreply.github.com>
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2022-01-28 17:55:55 +01:00
Thomas J. Fan 755d10a7fc
TST Adds object check for get_feature_names_out common test (#22250) 2022-01-27 15:41:40 +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
Ross Barnowski 24106c2149
DOC Fix incorrect heading underline length in docstrings (#22278) 2022-01-24 09:58:33 -05:00
Thomas J. Fan c131f7c96b
MNT Fixes Cython compile error on upstream (#22143)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2022-01-18 10:57:04 +01:00
mathurinm ff90467e0e
DOC Edit check_estimator docstring (#22190) 2022-01-11 10:02:47 -08:00
Adrin Jalali 1eb134e1c6
MNT move bunch to its own file (#22084) 2021-12-31 10:02:23 +01:00