Commit Graph

214 Commits

Author SHA1 Message Date
Guillaume Lemaitre 8cdeb8010c
FIX make coef_ in PLS estimator consistent with linear models (#22016)
Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2022-03-28 17:27:21 +02:00
Julien Jerphanion e7d718ccf2
TST use global_dtype in feature_selection/tests/test_mutual_info.py (#22677)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com>
2022-03-25 18:06:09 +01:00
Meekail Zain db24a30bd3
ENH Allow `SelectFromModel`'s `max_features` to accept callables (#22356)
* Initial implementation

* Improved error handling and stability

* Added unit tests

* Updated test to use `max_features_` instead of `max_features`

* Added documentation for new private attribute `max_features_`

* Improved error handling for callables

* Updated whats_new

* Removed incorrect term reference to `max_features`

* Removed float case and improved testing

* Updated test names to more clearly reflect intention

* Added a sample callable in `max_features` description

* Improved documentation and streamlined error handling

* Updated example to include demonstrate using a callable for max_features

* Separated out callable demo into separate example

* Removed demo from `max_features` docs (now in example)

* Updated changelog

* Apply suggestions from code review

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

* Trimmed unneeded comments

* Updated tests to reflect new error handling

* Removed new line at end of docstring

* Updated docstring

* Fixed example syntax error

* Fixed example syntax

* Apply suggestions from code review

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

* Reverted irrelevant changes

* Update sklearn/feature_selection/_from_model.py

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

* Fixed error message

* Improved test coverage

* Minor doc improvement -- added a list for `max_features` type

* Update sklearn/feature_selection/_from_model.py

Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>

* Improved input validation and added test for array-like

* Updated doc to use no longer use lambda function

* Fixed docstring list

* Added missing whitespace for list format in docstring

Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
2022-03-22 11:18:12 +01: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 1fc86b6aac
MNT Update black to stable version (#22474) 2022-02-15 11:36:26 +01:00
Meekail Zain e821a9e8a0
ENH preserves dtypes for GenericUnivariateSelect class (#22370)
Co-authored-by: Thierry Gameiro <titigmr@MacBook-Air-de-Thierry.local>
Co-authored-by: titigmr <thierry.gmr@outlook.fr>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2022-02-14 18:24:29 +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
murata-yu 30360ee997
ENH Adds n_features_to_select upper limit to SeqFeatureSelector (#20145)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: bmreiniger <40676050+bmreiniger@users.noreply.github.com>
2021-12-24 09:13:16 -05:00
Thomas J. Fan 6db0e2cd5f
FIX Improves feature names support for SelectFromModel + Est w/o names (#21991)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-12-24 14:16:25 +01:00
Maxwell 3766232448
ENH speed up test_unsupervised_model_fit (#22045)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-12-22 23:57:17 -05:00
Juan Carlos Alfaro Jiménez 7de08f5ced
ENH add a parameter force_finite to r_regression and f_regression (#17819)
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-12-20 08:40:09 +01:00
Jorge Loayza 3f8868072c
reduced n_samples and n_features in test_nan_support for faster pytest (#21823) 2021-12-02 21:13:23 +01: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
Shuhei Kayawari daec880bff
API Replacing grid_scores_ by cv_results_ in _rfe.py and test_rfe.py (#20161)
Co-authored-by: arka204 <kmichalik204@gmail.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-07-30 18:01:49 +02:00
Shyam Desai acc13de65e
FIX make SFS compatible wiht unsupervised estimator having a score method (#19568)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Chiara Marmo <cmarmo@users.noreply.github.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-07-29 17:01:29 +02:00
Felipe Rodrigues eb901df93f
ENH Allow `sample_weight` and other `fit_params` in RFE (#20380)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
2021-07-27 18:24:35 +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
Tomohiro Endo b5e5db4a43
API Raises an error when a negative threshold is chosen in VarianceThreshold (#20207) 2021-06-12 20:33:27 -04:00
naozin555 9406b3d2a4
TST Removed assert_warns_message from feature_selection/tests (#20158) 2021-05-28 13:53:10 +02:00
Julien Jerphanion d5ebdca662
[MRG] Refactor `feature_selection.f_regression` and introduce `feature_selection.r_regression` (#17169)
Co-authored-by: Dmytro S Lituiev <d.lituiev@gmail.com>
Co-authored-by: Chiara Marmo <chiara.marmo@u-psud.fr>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-04-21 10:49:18 +02:00
Nicolas Hug 309f135c32
MNT Remove HistGradientBoosting from experimental (#19799) 2021-04-02 16:40:20 +02: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
Nicolas Hug 5bf37e8425
FEA Add sequential feature selection transformer (#17159)
Co-authored-by: rasbt <mail@sebastianraschka.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2020-08-21 19:57:05 +02:00
Thomas J. Fan febdd191f5
TST Sets random_state in test_rfe_wrapped_estimator (#18097) 2020-08-06 12:07:51 +02:00
Lisa Schwetlick 911137f0de
ENH Enable percentage for n_features_to_select in RFE(Fix PR #16228) (#17090)
* added code from PR #14627

* fixed error handling None as n_features_to_select

* added test for error message and percentage passing

* linting

* more linting

* even more linting

* sklearn/feature_selection/_rfe.py make int casting simpler

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

* exchange redundant test case with small float

* add what's new

* removed useless import

* lint

* Fix whats_new/v0.24.rst

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

* move whats new section

* disambiguate choice between 1 feature and 100% of features

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

* move checking for negatives to _fit

* update error to include nones

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

* markdown style in what's new

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

* Update sklearn/feature_selection/tests/test_rfe.py

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

* forgot to delete line

* fix test for negative n_features error

* BUG Fixes issues

* added case for float >1 and more detailed error messages

* lint

* more lint

* more lint

* CLN Minor adjustments

* BLD Force build on ci

Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2020-06-26 22:40:25 -04: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
Venkatachalam N f6b8bc0ece
ENH add importance_getter to RFE* and SelectFromModel 2020-05-20 16:15:32 +10: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
Adrin Jalali c3817500cc
API feature_selection's constructor params -> kwonly (#16867) 2020-04-10 14:26:56 -04:00
Roman Feldbauer 9b39c4c4d2
TST Fix unreachable code in tests (#16110) 2020-02-16 14:41:26 +01:00
Divyaprabha M 63cfc5ff6b
ENH add multioutput support for RFE (#16103) 2020-02-04 20:33:35 +01:00
Nicolas Hug 4256542b10 MNT Removed deprecated attributes and parameters (#15803) 2019-12-09 22:17:06 +08:00
Alec Peters 70b0ddea99 FEA Allow nan/inf in feature selection (#11635) 2019-11-05 11:34:59 +11:00
Thomas J Fan 6769490424 MNT Make modules private in feature_selection (#15376) 2019-10-29 11:00:32 +08:00
Nicolas Hug b92455a6b2 MAINT Deprecate all of utils.testing except all_estimators (#15367) 2019-10-28 17:28:56 +01:00
Thomas J Fan 4a95e33e63 MNT Make modules private in sklearn.datasets (#15307) 2019-10-27 17:17:23 -04:00
Samesh Lakhotia a2968c2e4f MNT Fix assert raises in sklearn/feature_selection/tests/ (#14697) 2019-08-21 15:35:19 +08:00
Nicolas Hug f3eb9d2206 [MRG] MNT removing assert_equal, etc -- continued (#14232) 2019-07-02 14:53:51 +10:00
Adrin Jalali 19c068a2ec MNT towards removing assert_equal, etc (#14222) 2019-07-01 09:13:32 -04:00
Joel Nothman f339609ab8 TST attempt to fix the variance threshold part of #14192 (#14204) 2019-06-27 15:18:31 +02:00
Roman Yurchak 5674122c97 MAINT More test runtime optimizations (#14136)
* Feature extraction / feature selection

* Metrics, manifold, impute, GP optimization

* Optimize mixture

* Optimize model_selection

* Fix tests

* Lint
2019-06-22 10:44:06 +03:00
Roman Yurchak 0eedf99eee MAINT Don't use clean_warnings_registry in tests (#14085) 2019-06-17 14:10:05 +02:00
Roman Yurchak ccd3331f7e MNT remove unused imports (#14021) 2019-06-04 23:15:19 +10:00
Guillaume Lemaitre 9adba491a2 [MRG] DEP change the default of cv and n_splits (#13839) 2019-05-29 23:39:20 +10:00
rlms be03467b9c FIX Changed VarianceThreshold behaviour when threshold is zero. See #13691 (#13704) 2019-05-29 01:54:23 +10:00
Guillaume Lemaitre c28ef9ef2a DEP change the default of multi_class to 'auto' in logistic regression (#13807) 2019-05-22 09:57:15 -04:00
Guillaume Lemaitre 8a8e21b2a3 MNT Change the default value of n_estimators in forests (#13803) 2019-05-09 21:19:20 +08:00
Guillaume Lemaitre 7896b21562 MNT change default of solver in LogisiticRegression (#13805) 2019-05-08 21:31:39 +08:00
Leandro Hermida 2a5c845a60 FIX _estimate_mi discrete_features str and value check (#13497)
* discrete_features str and value check

* Update if logic

* Add discrete_features bad str value test

* Remove unnecessary nested isinstance str check

* Add back nested isinstance str check

* New/updates to tests

* Add v0.21 whats new entry

* Undo v0.21 whats new entry
2019-04-01 20:15:14 +02:00
Andreas Mueller d879b5cdbe MNT be more friendly in the deprecation warning of cv=3 (#13395)
* be more friendly in the deprecation of cv=3

* add hint on specifying cv

* catch all the right warnings
2019-03-05 19:28:34 +01:00