Commit Graph

593 Commits

Author SHA1 Message Date
101AlexMartin 2f99cdaba7
API replace mean_squared_error(square=False) by root_mean_squared_error (#26734)
Co-authored-by: Alejandro Martin <alejandro.martingil@tno.nl>
Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr>
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2023-09-16 14:58:37 +02:00
Guillaume Lemaitre 5d145bf760
DOC fixes intersphinx warnings (#26779)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2023-07-10 20:25:35 +00:00
Guillaume Lemaitre 8cac52f9d1
FEA add ValidationCurveDisplay in model_selection module (#25120)
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2023-06-14 17:08:43 +00:00
Adrin Jalali 62671a704f
FEAT SLEP006: metadata routing infrastructure (#24027)
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Omar Salman <omar.salman@arbisoft.com>
2023-06-02 16:43:31 -04:00
Meekail Zain 415b11a765
FEAT Add `HDBSCAN` as a new estimator in `sklearn.cluster` (#26385)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2023-05-31 16:02:28 +02:00
Guillaume Lemaitre 40e8c8e6fc
DOC use correct template name for displays (#26081) 2023-04-04 10:33:01 +00:00
Guillaume Lemaitre 84d4e5ddaa
DOC show from_estimator and from_predictions for Displays (#25994) 2023-03-30 17:53:04 +02:00
Jérémie du Boisberranger 9260f510ab
MAINT Clean-up deprecated if_delegate_has_method for 1.3 (#25879) 2023-03-16 17:13:03 -04:00
Thomas J. Fan 392fdee003
ENH Adds TargetEncoder (#25334)
Co-authored-by: Andreas Mueller <t3kcit@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Jovan Stojanovic <62058944+jovan-stojanovic@users.noreply.github.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2023-03-16 16:59:20 +01:00
Adrin Jalali fdaaf90653
MNT remove links to enable_hist_gradient_boosting (#25808) 2023-03-10 15:26:17 +00:00
Guillaume Lemaitre a7cd0ca44d
FIX propagate configuration to workers in parallel (#25363)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2023-01-20 12:44:35 -05:00
Gleb Levitski 9b536c1db9
DOC Add ledoit_wolf_shrinkage reference to the public api (#25255) 2023-01-14 17:32:50 +01:00
Thomas J. Fan 70c690ebdd
ENH Adds InconsistentVersionWarning when unpickling version doesn't match (#25297)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2023-01-12 10:32:23 +01:00
Guillaume Lemaitre 40d7d880ed
FEA add PredictionErrorDisplay (#18020)
Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
2022-11-25 12:51:46 +01:00
Guillaume Lemaitre 758fe0d9c7
FEA add LearningCurveDisplay to show plot learning curve (#24084)
Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr>
Co-authored-by: Arturo Amor <86408019+ArturoAmorQ@users.noreply.github.com>
2022-11-24 14:31:47 +01:00
Thomas J. Fan 1dc23d7a1a
ENH Makes OneToOneFeatureMixin and ClassNamePrefixFeaturesOutMixin public (#24688)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2022-10-18 23:20:17 +02:00
Jérémie du Boisberranger 6818c9baec
MAINT Clean deprecation for 1.2: load_boston follow-up (#24653)
* remove load_boston references from the docs

* iter

* update poor_score
2022-10-13 17:31:36 +02:00
Guillaume Lemaitre b22f7fa552
MNT numpydoc validation for Displays (#21469)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
2022-09-26 23:54:29 +02:00
Jérémie du Boisberranger ee5d4ce151
MAINT Clean deprecation for 1.2: plot functions (#24445) 2022-09-16 17:07:25 +02:00
Arturo Amor 9d4819791b
FEA Add positive and negative likelihood ratios to metrics (#22518)
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Gael Varoquaux <gael.varoquaux@normalesup.org>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2022-05-17 10:39:48 +02:00
Tom Dupré la Tour b94bc5ea68
ENH add new function sort_graph_by_row_values (#23139)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2022-05-11 11:54:50 +02:00
michalkrawczyk 0822851f5c
FEA Bisecting K-Means (#20031)
Co-authored-by: Gael Varoquaux <gael.varoquaux@normalesup.org>
Co-authored-by: Tom Dupré la Tour <tom.dupre-la-tour@m4x.org>
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
2022-04-26 14:54:15 +02:00
Chiara Marmo 69132ebbd3
FEA Online implementation of non-negative matrix factorization (#16948)
Co-authored-by: Tom Dupré la Tour <tom.dupre-la-tour@m4x.org>
Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
2022-04-22 17:51:06 +02:00
Ohad Michel aeeac1c1d6
ENH add D2 pinbal score and D2 absolute error score (#22118) 2022-04-10 19:19:52 +02:00
Thomas J. Fan d400723a21
FEA Add DecisionBoundaryDisplay (#16061)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
2022-03-29 16:36:31 +02:00
Thomas J. Fan cb547ae5d1
DOC Makes Sphinx reference to Bunch a class (#22948) 2022-03-25 22:27:51 +01:00
Adrin Jalali 7dc97a378e
API get_scorer returns a copy and introduce get_scorer_names (#22866) 2022-03-20 07:30:21 +11:00
Jérémie du Boisberranger b9bd2d524d
API Deprecate if_delegate_has_method (#22830) 2022-03-17 13:16:53 -04:00
Julien Jerphanion 6b332d9969
MNT Move `DistanceMetric` under `metrics` (#21177) 2021-10-08 17:57:32 +02:00
Christian Lorentzen 9061ff9e58
FEA add d2_tweedie_score (#17036) 2021-09-04 23:17:03 +02:00
Lucy Liu da36f72cc2
ENH Add CalibrationDisplay plotting class (#17443)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-08-31 09:43:05 +02:00
Julien Jerphanion 20ee33a95a
DOC Remove `graph_shortest_path` references (#20677) 2021-08-04 16:40:16 +02:00
Joel Nothman ed3642014b
ENH Add available_if as a generic, literate variant of if_delegate_has_method (#19948)
* Better documentation where if_delegate_has_method is inapplicable

Fixes #19923

Introduces an elegant alternative for if_delegate_has_method, a decorator called available_if, which uses a callable to determine if an object should show a particular attribute.

If the callable also accepted the attribute name being decorated as a parameter, this could be used to implement if_delegate_has_method.

We could also replace if_delegate_has_method in all cases, since the code might be more readable as @available_if(lambda self, method: hasattr(self.base_estimator, method))

Possible alternative naming of available_if: hasattr_if.

TODO: add tests of the new decorator

* Fix use of super()

* Fixes to silly errors...

* add noqa

* Fix docstring issues

* remove debugging statements

* Use available_if instead of if_delegate_has_method in multioutput

* Public to private

* Rm unused import

* Black

* Use a sentinel instead of for-else with early return

* update reference docs

* TST

* DOC Add change log

* Update doc/whats_new/v1.0.rst

* Make test make sense

* Black

* Define available_if function in class

* Another way to express multioutput delegations
2021-07-11 15:36:26 +02:00
David Dale c1cc67dd06
FEA Add QuantileRegressor estimator (#9978)
Co-authored-by: David Dale <ddale@yandex-team.ru>
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
2021-05-25 14:02:37 +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
Albert Thomas c854b83c91
[MRG] Linear One-Class SVM using SGD implementation (#10027)
Co-authored-by: Tom Dupré la Tour <tom.dupre-la-tour@m4x.org>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-03-23 10:53:57 +01:00
Rodion Martynov 0892a98fc9
Stratified Group KFold implementation (#18649)
* Initial implementation

* Forgot to add to second __add__ list

* Update split method parameter doc

* Added example; changed default test_size to 0.1; added to author list

* StratifiedGroupKFold impl and other improvements

* Add class to __all__ spec

* Remove random_state when no shuffle

* Tighter formatting

* Update the implementation of StratifiedGroupKFold

* Add StratifiedGroupKFold to __init__

* Add y checks to StartifiedGroupKFold

* Raise error if n_splits > max num samples in class

* Warn if n_splits > mn num samples in class

* Add SGKfold to general repr test

* Add SGKFold to 2d_y test case

* Add SGKfold to value erros test case

Parameters are the same as for StratifiedKFold
to ensure similar behavior given n_groups == n_samples

* Add SGKFold to StratifiedKFold test cases

The idea is to ensure similar behavior when groups are trivial
(n_groups == n_samples)

* Add SGKFold to reproducibility test case

* Add SGKFold to GroupKFold test case

* Add SGKFold to nested cv test case

* Add SGKFold to random_state with shuffle=False test case

* Add SGKFold to constant splits test case

* Fix repr test case

* Fix formatting issues

* Add samples to a fold with least num samples

Required to produce balanced size folds when the distribution of y is
more or less the same

* Remove GroupShuffleSplit impl

* Add notes to StratifiedGroupKFold

* Fix doctest

* Added stratified group kfold tests

* Better variable naming

* Add section to documentation

* Remove leftover StratifiedGroupShuffleSplit import

* Add changelist and reference to original kernel

* Better naming for least populated class check

* Better expression for number of labels

* Remove use of Counter

We already have this data in output of np.unique

* Add tests for homogeneous groups

* Add StratifiedGroupKFold test against GroupKFold

* Add changes to changelist in docstring

* Add StratifiedGroupKFold to classes.rst

* Fix description of StratifiedGroupKFold

* Move license notice out of docstring

* Disambiguate labels to classes in doc

* Add changelog entry

* Fix changelog author entry

* Fix StratifiedGroupKFold docstring

* Better variable names

* Remove defaultdict in favor of numpy indexing

* Extracted best_fold search into a separate method

* Make use of numpy broadcasting instead of for loop

* Encode groups and use arrays instead of dicts

* Use numpy sort instead of python

* Clarify shuffling behavior of StratifiedGroupKF in docs

* Switch name from label_idx to class_idx

* Remove accidentally leftover comment

* Fix np.sort keyword to support numpy < 1.15

* Fix typo in docstring

* Add StratifiedGroupKFold to visualization doc

* Add visualization for uneven group as an example

* Fix image numbers to match updated example

* Add author

* Add SGKF visualization to docs

* Add comments for groups in stratified CV tests

Co-authored-by: Leandro Hermida <hermidal@cs.umd.edu>
Co-authored-by: marrodion <rodion_martynov@epam.com>
2021-03-20 21:57:42 +11:00
Sean Benhur J 04f84c6d08
DOC Added utils.gen_batches in documentation (#19688) 2021-03-17 15:53:00 +01:00
xavier dupré 6a6217f15f
ENH Add mean_pinball_loss metric for quantile regression (#19415)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
2021-02-18 19:43:40 +01:00
Christian Lorentzen 27f1c737f2
FEA Add SplineTransformer (#18368) 2021-01-24 10:53:27 +01:00
Guillaume Lemaitre 2218ec4622
MNT change 0.25 to 1.0 and 0.26 to 1.1 in deprecation messages (#19005)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2020-12-18 16:09:19 +00:00
Patrice Becker 2f6af711b0
FEA Add Self Training Estimator (#11682)
Co-authored-by: Oliver Rausch <oliverrausch@users.noreply.github.com>
Co-authored-by: Patrice Becker <patricelbecker@gmail.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2020-11-20 19:49:08 +01:00
Gordon Walsh 11f9742992
[ENH] Create public kmeans_plusplus including index output (#17937) 2020-11-11 15:24:03 +01:00
ufmayer 662cc647d9
FEA Add Rand Index and pair confusion matrix (#17412)
Co-authored-by: Chiara Marmo <cmarmo@users.noreply.github.com>
2020-10-28 14:28:11 +01:00
Geoffrey Bolmier 5654da026b
FEA Top k accuracy metric (#16625)
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Co-authored-by: Jeremiah Johnson <jwjohnson314@gmail.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2020-10-16 16:51:41 +02:00
Thomas J. Fan 3b334c5b25
MNT Uses enable_halving_search_cv instead (#18563) 2020-10-09 07:49:20 +11:00
Lucy Liu 18a4841667
DOC Add common pitfalls: data leakage (#18426)
* Add common pitfalls on data leakage (#18426)
2020-10-08 08:42:37 +02:00
Joshua Newton 6d1104e332
DOC Restructure Multiclass and multilabel in User Guide (#17811) 2020-09-17 12:21:51 -04:00
Juan Carlos Alfaro Jiménez 2b79665b90
DOC Add enable_successive_halving module to the API Reference (#18402) 2020-09-15 15:08:14 -04:00
Nicolas Hug 0a5af0d2a1
FEA Successive halving for faster parameter search (#13900)
* More flexible grid search interface

* added info dict parameter

* Put back removed test

* renamed info into more_results

* Passed grroups as well since we need n_to use get_n_splits(X, y, groups)

* port

* pep8

* dabl -> sklearn

* add _required_parameters

* skipping check in rst file if pandas not installed

* Update sklearn/model_selection/_search_successive_halving.py

Co-Authored-By: Joel Nothman <joel.nothman@gmail.com>

* renamed into GridHalvingSearchCV and RandomHalvingSearchCV

* Addressed thomas' comments

* repr

* removed passing group as a parameter to evaluate_candidates

* Joels comments

* pep8

* reorganized user user guide

* renaming

* update user guide

* remove groups support + pass fit_params

* parameter renaming

* pep8

* r_i -> resource_iter

* fixed r_i issues

* examples + removed use of word budget

* Added inpute checking tests

* added cv_resutlts_ user guide

* minor title change

* fixed doc layout

* Addressed some comments

* properly pass down fit_params

* change default value of force_exhaust_resources and update doc

* should fix doc

* Used check_fit_params

* Update section about min_resources and number of candidates

* Clarified ratio section

* Use ~ to refer to classes

* fixed doc checks

* Apply suggestions from code review

Co-authored-by: Joel Nothman <joel.nothman@gmail.com>

* Addressed easy comments from Joel

* missed some

* updated docstring of run_search

* Used f strings instead of format

* remove candidate duplication checks

* fix example

* Addressed easy comments

* rotate ticks labels

* Added discussion in the intro as suggested by Joel

* Split examples into sections

* minor changes

* remove force_exhaust_budget and introduce min_resources=exhaust

* some minor validation

* Added a n_resources_ attribute

* update examples

* Addressed comments

* passing CV instead of X,y

* minor revert for handling fit_params

* updated docs

* fix len

* whatsnew

* Add test for sampling when all_list

* minor change to top-k

* Force CV splits to be consistent across calls

* reorder parameters

* reduced diff

* added tests for top_k

* put back doc for groups

* not sure what went wrong

* put import at its place

* some comment

* Addressed comments

* Added tests for cv_results_ and base estimator inputs

* pep8

* avoid monkeypatching

* rename df

* use Joel's suggestions for testing masks

* Made it experimental

* Should fix docs

* whats new entry

* Apply suggestions from code review

Co-authored-by: Andreas Mueller <t3kcit@gmail.com>

* Addressed comments to docs

* Addressed comments in examples

* minor doc update

* minor renaming in UG

* forgot some

* some sad note about splitter statefulness :'(

* Addressed comments

* ratio -> factor

Co-authored-by: Joel Nothman <joel.nothman@gmail.com>
Co-authored-by: Andreas Mueller <t3kcit@gmail.com>
2020-09-09 17:12:35 +02:00