Commit Graph

130 Commits

Author SHA1 Message Date
cdrig e5930594db
format notebook plot_roc_crossval.py (#22799)
Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
2022-03-18 14:58:27 +01:00
Brenden Kadota 3a428086dd
DOC updated to notebook style for grid_search_text_feature_extraction.py (#22558)
Co-authored-by: Arturo Amor <86408019+ArturoAmorQ@users.noreply.github.com>
Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
2022-03-12 15:40:26 +01:00
Sven Eschlbeck 5137abfb16
Increased speed by adding cv and n_jobs params plot_multi_metric_evaluation.py (#21626)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
2022-02-23 14:08:26 +01:00
Brenden Kadota ca705e8474
DOC Replace image vectorization with built-in fields (#22516) 2022-02-17 17:10:53 +01:00
Brenden Kadota 835904a764
DOC use notebook-style for plot_train_error_vs_test_error (#22440) 2022-02-14 11:45:57 +01:00
KimAYoung 02b41de8fc
DOC Fix deprecation warning in plot_roc (#21911) 2021-12-07 09:43:05 -05:00
sply88 64d2fdb4aa
DOC accelerate plot_successive_halving_iterations.py example #21598 (#21612)
* accelerate plot_successive_halving_iterations.py example #21598

* n_estimators back to 20
2021-11-29 13:43:09 +01:00
Thomas J. Fan deeda9736a
EXA Sort fit times fot score vs fit_times in learning curve example (#21777) 2021-11-25 15:15:31 +01:00
Sven Eschlbeck 7bfa9ccd7c
DOC increase speed in plot_validation_curve.py (#21638)
* Changed n_jobs parameter to increase speed

* Update plot_validation_curve.py

* Update plot_validation_curve.py
2021-11-16 18:52:19 +01:00
sply88 d7ddffe9c1
ENH accelerate plot_randomized_search.py (#21637) 2021-11-16 09:44:40 -08:00
Sven Eschlbeck 263181a96f
ENH Improve speed plot_permutation_tests_for_classification.py (#21649) 2021-11-16 09:14:47 -08:00
Sven Eschlbeck 31a75c004d
DOC increase speed in plot_learning_curve.py (#21628)
* Adapted the number of splits

* Update plot_learning_curve.py

* Update plot_learning_curve.py

Added ``random_state=0`` to call of ``learning_curve``

* Update plot_learning_curve.py

Added ``shuffle=True`` for ``random_state`` to make an impact

* Update examples/model_selection/plot_learning_curve.py

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

Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-11-16 15:07:10 +01:00
Dimitri Papadopoulos Orfanos d4d5f8c7e0
MAINT consistent use of `print(__doc__)` in examples (#21307)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-10-22 15:33:22 +02:00
Kranthi Sedamaki 7b489b5fea
DOC rename multilabel to multiclass in Plot ROC subtitle (#21322) 2021-10-14 18:04:39 +02:00
Thomas J. Fan 70a185ae59
MAINT Enable and run black on examples (#20502) 2021-10-07 10:13:00 +02:00
Dimitri Papadopoulos Orfanos f71c031314
DOC Typos found by codespell (#21069) 2021-09-17 19:04:54 +02:00
Guillaume Lemaitre f46190846c
API add from_estimator and from_predictions to RocCurveDisplay (#20569)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-09-03 17:19:46 +02:00
Guillaume Lemaitre d4da690822
API add from_estimator and from_preditions to PrecisionRecallDisplay (#20552)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2021-08-31 10:51:32 +02:00
Guillaume Lemaitre d753d4dc1a
API deprecate plot_det_curve in favor of display class methods (#19278) 2021-08-06 17:36:24 +02:00
Guillaume Lemaitre 86476347b3
DOC solve plotting issue in plot_permutation_test_for_classification (#20637) 2021-07-31 10:24:50 +02:00
Gael Varoquaux 2c2c6ca94b
DOC move example permutation test example to model selection module (#20624) 2021-07-28 14:49:42 +02:00
Paweł Olszewski 57daa2de79
DOC fixes typo and comment in example plot_grid_search_stats.py (#20447)
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
2021-07-22 22:34:09 +02:00
Paweł Olszewski c3a3b1e602
EXA Fix issue in Statistical comparison of models using grid search (#19966) 2021-06-21 21:46:33 +02:00
Thomas J. Fan 81dde3a6e5
STY Ensures that "flake8 ." works (#20298) 2021-06-18 15:46:40 +02:00
kobaski 495ff48a7c
[MRG] resolve ambiguity of the nested cross-val example (#20148)
* resolve ambiguity of the nested cross-val example

* Update examples/model_selection/plot_nested_cross_validation_iris.py

make it more explict

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

Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-05-27 23:43:13 +10: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
Alessia Marcolini 95c3c762fb
DOC Fix typo in plot_multi_metric_evaluation example (#19675) 2021-03-15 10:46:22 +01:00
Guillaume Lemaitre 8c6a045e46
ENH/DEP add class method and deprecate plot function for confusion matrix (#18543)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
2021-01-22 19:57:41 +01:00
Guillaume Lemaitre 266a11b2e1
DOC Update docs guideline regarding docstring formatting (#18243)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
2021-01-08 12:55:53 -05:00
Chiara Marmo e8a364b471
DOC Fix ref section of grid search stats example (#18949) 2020-12-01 09:38:00 +00:00
Martina G. Vilas 5e85a65ab6
DOC Add grid search stats example (#17432) 2020-11-06 17:39:35 +00:00
Thomas J. Fan 3b334c5b25
MNT Uses enable_halving_search_cv instead (#18563) 2020-10-09 07:49:20 +11:00
Juan Carlos Alfaro Jiménez 373946ec9e
DOC Fix x-axis label positions for SH iterations example (#18380)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2020-09-12 11:13:49 -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
Guillaume Lemaitre e030010c6c
ENH Adds plot_det_curve and associated display (#18176)
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2020-08-28 22:36:52 -04:00
Oleh Kozynets d873ed152a
DOC Fix docstring in examples (#18251)
Co-authored-by: Oleh Kozynets <olehkss@github.com>
2020-08-26 10:07:02 +02:00
Guillaume Lemaitre bf4714f401
ENH follow-up style improvements of DET curves #10591 (#18169)
* follow-up on #10591 

* DOC improvements

* TST add additional test for pos_label

Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
2020-08-19 12:39:56 +02:00
Daniel Mohns 41d648ef88
[MRG] Add Detection Error Tradeoff (DET) curve classification metrics (#10591)
* Initial add DET curve to classification metrics

* Add DET to exports

* Fix DET-curve doctest errors

- Sample snippet in  model_evaluation documentation was outdated.

* Clarify wording in DET-curve computation

- Align to the wording of ranking module to make it consistent.
- Add correct describtion of input and outputs.
- Update and fix non-existent links

* Beautify DET curve documentation source

- Limit line length to 80 characters.

* Expand DET curve documentation

- Add an example plot to show difference between ROC and DET curves.
- Expand Usage Note section with background information and properties
of DET curves.

* Update DET-curve documentation

- Fix typos and some grammar improvements.
- Use named references to avoid potential conflicts with other sections.
- Remove unneeded references and improved existing ones by using e.g.
using versioned links.

* Select relevant DET points using slice object

* Remove some dubiety from DET curve doc-string

* Add DET curve contributors

* Add tests for DET curves

* Streamline DET test by using parametrization

* Increase verbosity of DET curve error handling

- Explicitly sanity check input before computing a DET curve.
- Add test for perfect scores.
- Adapt indentation style to match the test module.

* Add reference for DET curves in invariance test

* Add automated invariance checks for DET curves

* Resolve merge artifacts

* Make doctest happy

* Fix whitespaces for doctest

* Revert unintended whitespace changes

* Revert unintended white space changes #2

* Fix typos and grammar

* Fix white space in doc

* Streamline test code

* Remove rebase artifacts

* Fix PR link in doc

* Fix test_ranking

* Fix rebase errors

* Fix import

* Bring back newlines

- Swallowed by copy/paste

* Remove uncited ref link

* Remove matplotlib deprecation warning

* Bring back hidden reference

* Add motivation to DET example

* Fix lint

* Add citation

* Use modern matplotlib API

Co-authored-by: Jeremy Karnowski <jeremy.karnowski@gmail.com>
Co-authored-by: Julien Cornebise <julien@cornebise.com>
Co-authored-by: Daniel Mohns <daniel.mohns@zenguard.org>
2020-08-16 11:34:37 +02:00
Maren Westermann 4e8dc9db5c
DOC shorten links in examples/* modules (#17636)
* shorten links in examples

* fix linting errors
2020-06-20 17:43:14 +02:00
Roman Yurchak 94f2e9c5d8
DOC simpler block delimitation in sphinx-gallery examples (#17068)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2020-06-08 23:23:14 -04:00
Sergio b70472bd24
DOC correct estimator name in example (#17239) 2020-05-16 18:07:33 -04:00
Nicolas Hug ad6fc80425
DOC fix indentation in cv parameter description (#17161) 2020-05-08 16:03:43 -04:00
Lucy Liu 92ed38598f
DOC Fix deprecation warning in plot_roc_crossval (#17155) 2020-05-07 20:01:04 -04:00
maikia 43fd8c9246
DOC exchanged boston for diabetes dataset in plot_cv_predict (#16312) 2020-01-30 13:02:06 -05:00
Brian Wignall 0e10b3a3cb DOC Fix typos, via a Levenshtein-style corrector (#15923) 2019-12-19 16:26:02 -08:00
Thomas J Fan e650a207ef ENH Adds plot_confusion matrix (#15083) 2019-11-14 14:43:54 +01:00
Thomas J Fan 968252dfb4 FEA Adds plot_precision_recall_curve (#14936) 2019-11-10 20:54:35 -06:00
Scott Sievert 7cb5dafebb FEA Implements log-uniform random variable (#11232) 2019-10-02 13:56:24 +02:00
Rok Mihevc 5e4b2757d6 TST Adding multi-output checks to common tests (#13392) 2019-10-01 14:20:11 +02:00
Thomas J Fan 14f5302b70 DOC Link items explictly (#14817)
* DOC Link items explictly

* STY

* DOC Link another
2019-09-05 11:37:05 +02:00