Commit Graph

23 Commits

Author SHA1 Message Date
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
Jack Liu f12987de98
MNT Replace if_delegate_has_method with available_if in feature_selection (#20593)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
2022-03-13 21:13:45 +01: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
Juan Martin Loyola 8bf222a016
DOC Ensures that SelectFromModel passes numpydoc validation (#20988)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-09-09 11:08:58 +02:00
Thomas J. Fan 786c4e5e39
DOC Adds feature_names_in_ to docstrings (#20787) 2021-08-26 13:44:45 +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 351ace7935
STY Uses black's with target_version >= 3.7 (#20294) 2021-06-17 15:50:27 -04:00
Thomas J. Fan 82df48934e
MNT Applies black formatting to most of the code base (#18948) 2021-06-17 14:21:09 -04:00
Guillaume Lemaitre 95afec8742
TST create instances from exotic estimators for docstring params check (#20243)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-06-11 18:38:22 +02:00
Tom Dupré la Tour f6e6ad2d9e
MNT clean futurewarning for 1.0 | _deprecate_positional_args (#20002)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2021-05-14 11:30:27 -04:00
EdwinWenink 0cc91e7e57
DOC fix ungrammatical sentence in doc of SelectFromModel (#19240)
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
2021-02-01 21:07:19 +01: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
Albert Villanova del Moral 647fcb1ac1
DOC Fix A to uppercase in See Also docstring section (#18332) 2020-09-04 10:35:01 -04: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
Aura Munoz 5297365ebe
DOC Standarize default documentation for feature_selection (#17465)
* doc: Standarize default documentation for feature_selection

- Change `default` documentation of parameters to follow `default=<value>`
template

* remove space at end-of-line

* fix linting issues

* address comments

* missing file
2020-06-07 17:27:36 +02:00
Pardeep Singh 2653fa939b
DOC shorten estimators links for sklearn/feature_selection/* and sklearn/experimental/* modules (#17466)
* Shorten Estimators Links for sklearn/experimental/* module docs

* Shorten Estimators Links for sklearn/feature_selection/* module docs
2020-06-06 12:42:59 -04:00
Venkatachalam N f6b8bc0ece
ENH add importance_getter to RFE* and SelectFromModel 2020-05-20 16:15:32 +10:00
Adrin Jalali c3817500cc
API feature_selection's constructor params -> kwonly (#16867) 2020-04-10 14:26:56 -04:00
Nicolas Hug 44c44a5742
DOC minimal docstring fix + UG for feature selection (#16810) 2020-03-31 08:19:54 -04:00
Nicolas Hug d205638475
MNT Introduction of n_features_in_ attr with _validate_data mtd (#16112) 2020-02-29 09:05:11 -05: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