Commit Graph

81 Commits

Author SHA1 Message Date
Prabakaran Kumaresshan 41aa3edd78 MNT Remove build_tools/windows/windows_testing_downloader.ps1 (#12974) 2019-01-15 09:28:51 +01:00
Rüdiger Busche d300f406ae MAINT Simplify super() calls (#12812) 2019-01-10 22:27:06 +01:00
Roman Yurchak 701144559f MAINT Remove unused utils.fixes (#12928)
This continues the work done in https://github.com/scikit-learn/scikit-learn/pull/12639 on dropping the python 2 support by,
 - ~~removing unnecessary `from __future__` imports~~
 - removing unused `sklearn.utils.fixes` assuming we can agree in https://github.com/scikit-learn/scikit-learn/issues/12927 that `sklearn.utils.fixes` are private as was stated e.g. in https://github.com/scikit-learn/scikit-learn/issues/6616#issuecomment-245109979
2019-01-08 12:43:49 +11:00
Andreas Mueller 952ef6637a MRG Drop legacy python / remove six dependencies (#12639) 2019-01-03 15:50:05 +02:00
Dowon 0e5feb6bf7 DOC improving import convenience in class examples (#12846) 2018-12-23 09:37:43 +08:00
Dror Atariah 440c08684f FIX Add more validation for size parameters in train_test_split (#12733)
* Fixed typo in an example

* Removed un-needed lines from example

* Added tests on the validity of parameters

* Fixed error msg for train_size issue

* Added tests to check the validation of test and train sizes

* Switched to parameterized test

* Fixed typo in error msg

* Swithced to pytest.raises

* Swithced to pytest.raises also when checking msg

* Improved the validity tests and their unit testing
2018-12-19 12:36:53 +01:00
Adrin Jalali 2bd87f6ed8 Remove python < 3.5 from CI (#12746) 2018-12-14 10:53:12 +01:00
Sam Waterbury 1d579556d2 DOV consistency of parameters for GroupKFold and LeaveOneGroupOut (#12581) 2018-11-18 10:05:48 +11:00
Quentin Batista 4b78d7abf4 DOC: Clarify `cv` parameter description in `GridSearchCV` (#12495)
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to the issues or pull requests
you resolved, so that they will automatically be closed when your pull request
is merged. See https://github.com/blog/1506-closing-issues-via-pull-requests
-->

This PR addresses issue #12466.

#### What does this implement/fix? Explain your changes.

This PR does the 3 following things:
- Rewrite the `cv` parameter description in `GridSearchCV`
- Link the new `CV splitter` description to an existing example
- Add an example with a custom iterable

Thanks for reviewing this!

Close #12466
2018-11-12 15:10:15 -05:00
Guillaume Lemaitre 5431a1a9bf BUG: check equality instead of identity in check_cv (#12155) 2018-09-25 19:00:27 +08:00
Zijie (ZJ) Poh 41178cd62d DOC Fix: require n_splits > 1 in TimeSeriesSplit (#11937) 2018-08-29 17:51:46 +10:00
Hanmin Qin 5533deb8e0 [MRG] FIX Support cv=None in *CV (#11761) 2018-08-07 11:53:59 +10:00
ZJ Poh adddf00433 [MRG] np.ones -> np.full (#11628) 2018-07-23 09:49:01 +02:00
Alexandre Boucaud f158e2dfe2 [MRG+1] Change CV defaults to 5 (#11557)
* add FutureWarning for methods with defaults=3

* add explicit cv values to fix assertion errors

* add tests for catching the FutureWarning

* Write current deprecation version

* Add deprecation in docstring

* change default cv value to None

* change cv from 3 to 5 in the examples

* upgrade doctests

* update doctest in tutorial

* update doctest in cross-validation doc

* fix tests

* add entry to whats new

* address Gael comments

* address Gael comments 2

* fix wrong indentation

* update doc

* add docstring deprecation warning in CV subclasses

* address Andy's comments

* fix PR number

* fix flake8

* add filterwarnings in tests

* fix doctests

* cv=None mendatory in Ridge

* fix warning related errors

* skip some doctests warnings

* make travis happy

* change from deprecated to versionchanged

* fix doctests and remove skipping

* address comments
2018-07-19 14:46:11 +02:00
Roman Yurchak c09352c241 [MRG] Fix DeprecationWarning due to collections.abc in Python 3.7 (#11431)
Closes https://github.com/scikit-learn/scikit-learn/issues/11121

This PR removes the deprecation warning about ABC being moved from `collections` to `collections.abc` when importing scikit-learn in Python 3.7.

In the end, I put `collections.abc.{Sequence, Iterable, Mapping, Sized}` in the namespace of `sklearn.utils.fixes`. This was the simplest way I could find, and while it has the drawback of obfuscating the real module name, other approached appeared more problematic and a similar approach is currently used e.g. for `utils.fixes.signature` which is an alias for `inspect.signature`.

We can't just patch six with https://github.com/benjaminp/six/pull/241, because sklearn uses six from 5 years ago, which would  need updating and I'm not sure if it could have side effects (e.g. for pickling backward compatibility etc).

**Edit**: This adds a test checking that generally no warnings are raised when importing scikit-learn top-level modules.
2018-07-14 15:14:02 -05:00
Andreas Mueller eec7649236 MAINT Complete 0.20 deprecations (#9570) 2018-06-24 23:06:26 +10:00
Andrew Peng f1a3312cd7 FIX #11215 : Changing return in docstring to yields for generator functions (#11276) 2018-06-15 21:50:01 +00:00
Jason Wolosonovich 0dec5b669c DOC: added default value for test_size in train_test_split (#11068) 2018-05-06 11:31:25 +10:00
Nicholas Nadeau, P.Eng., AVS 3e26fc63be MAINT Fixing Typos (#11017) 2018-04-24 09:32:25 +10:00
Will Rosenfeld f96ee8d730 DOC Remove random_state note from TimeSeriesSplit, and add where needed (#10696) 2018-02-28 18:41:58 +11:00
William de Vazelhes de9d05f426 [MRG+1]DOC StratifiedKFold docstring fix (#10155) 2018-01-18 09:12:31 +08:00
Jeb Bearer ea6ea815e1 MAINT Hide train_test_split from nose test discovery. (#10223) 2017-12-07 08:15:20 +11:00
Nicolas Hug 02c7f986eb Fix typo in ShuffleSplit docstring and effective_n_jobs (#10182) 2017-11-21 14:48:07 -05:00
Loïc Estève e7e05d844f [MRG+1] Remove nose from CIs and documentation (#9840) 2017-11-16 20:20:35 +01:00
Charlie Brummitt d074e403f1 [MRG+1] Fix bug in StratifiedShuffleSplit for multi-label data with targets having > 1000 labels (#9922)
* Use ' '.join(row) for multi-label targets in StratifiedShuffleSplit because str(row) uses an ellipsis when len(row) > 1000
* Add a new test for multilabel problems with more than a thousand labels
2017-10-17 09:44:35 +02:00
Andreas Mueller 94fa697356 [MRG+1] check that splitters handle 2d y and give reasonable errors on multilabel y (#9744) 2017-10-09 11:22:15 +02:00
Albert Thomas 45dc891c96 [MRG+2] Clean common tests (#9340)
* rm dupes

* add check_supervised_y_no_nan in classifier checks: this implies changes for Ridge classifiers

* fix docstrings/comments

* FIX check fitting 1d X array raises error and FIX check fitting 2d array with only 1 feature either works or returns informative message

* modify check_fit2d_1sample in common tests so that it checks fitting either works or returns an informative message

* rm SpectralClustering case for the moment

* uniformize error messages for 1 sample case and fix SpectralClustering with ensure_min_samples=2

* add unit test for mean_shift when n_samples * quantile < 1

* FIX travis with ensure_min_samples=2 in _PLS

* try fix for failing tSNE test

* typos

* take @agramfort's review into account

* sc to fix string in gaussian_process

* add the class that is present to preserve information of previous message in gpc.py
2017-09-26 18:13:15 +02:00
Kye Taylor a324a61eea [MRG+1] Fix #9743: Adding parameter information to docstring. (#9757)
* Adding parameter information to docstring.

* Removing trailing whitespace from lines.

* Adding details of parameter to formal Parameters section.

* Shortened lines to meet requirements.
2017-09-15 11:17:45 +10:00
Andreas Mueller 334850fa2b Note->Notes, fix underline in multioutput examples (#9416) 2017-07-20 14:01:30 +02:00
Balakumaran Manoharan 7b7960ef87 [MRG + 1] Fix wrong error message in StratifiedKFold (#9396)
* Fix wrong error message in StratifiedKFold

* Remove groups in warning message
2017-07-19 09:25:27 +10:00
(Venkat) Raghav, Rajagopalan 75d6005fea [MRG] Add few more tests + Documentation for re-entrant cross-validation estimators (#7823)
* DOC Add NOTE that unless random_state is set, split will not be identical

* TST use np.testing.assert_equal for nested lists/arrays

* TST Make sure cv param can be a generator

* DOC rank_ becomes a link when rendered

* Use test_...

* Remove blank line; Add if shuffle is True

* Fix tests

* Explicitly test for GeneratorType

* TST Add the else clause

* TST Add comment on usage of np.testing.assert_array_equal

* TYPO

* MNT Remove if ;

* Address Joel's comments

* merge the identical points in doc

* DOC address Andy's comments

* Move comment to before the check for generator type
2017-07-17 08:58:59 +10:00
Joel Nothman 0cdd91d8e4 [MRG] COSMIT Remove unused parameters in private functions (#9310)
* Remove unused parameter

* COSMIT another unused parameter

* COSMIT another unused parameter
2017-07-10 10:22:00 +02:00
Andreas Mueller 5271a193c3 MRG Sphinx fixes (#9155) 2017-06-28 17:00:13 +02:00
Joel Nothman 3c6c913bd8 [MRG+2] ENH Speed up StratifiedShuffleSplit (#9197)
* ENH Speed up StratifiedShuffleSplit

* Doc balance parentheses in comment
2017-06-26 12:56:40 -07:00
Nelson Liu 1f781e64a2 [MRG+3] CV splitters: train/test_size default behavior will change in 0.21 (#7459) 2017-06-14 21:28:52 +10:00
Vlad Niculae 93563b0ac1 [MRG+1] fix StratifiedShuffleSplit with 2d y (#9044)
* regression test and fix for 2d stratified shuffle split

* strengthen non-overlap sss tests

* clarify test and comment

* remove iter from tests, use str instead of hash
2017-06-13 17:40:45 +05:30
Naoya Kanai 95aa2952e1 Add logsumexp and comb to utils.fixes (#9046) 2017-06-10 15:01:02 +02:00
Alexandre Gramfort 32f2418a07 use ValueError 2017-06-08 11:44:54 +02:00
themrmax eaebfe0535 [MRG+1] add shuffle paramater to train_test_split (#8845)
* add shuffle paramater to train_test_split

* fix syntax error

* fix variable name

* fix formatting in doctest output

* fix doctest output

* refactor shuffle paramater into ShuffleSplit and StratifiedShuffleSplit

* include shuffle option in tests

* rollback refactor

* revert to simpler version of unshuffled split

* fix flake8 errors

* revert changes to ShuffleSplit

* revert BaseShuffleSplit

* more reversions

* fix indentation

* remove shuffle parameter from CVclass

* add text to NotImplementedError

* change indexing to use numpy.arange rather than range

* specify precondition for stratify to be None in docstring
2017-06-08 11:43:22 +02:00
Aman Dalmia 511c9a8655 [MRG+1] ENH: added max_train_size to TimeSeriesSplit (#8282)
* ENH: added max_train_size to TimeSeriesSplit

* FIX: update doctest

* FIX: correct error in the previous update

* FIX: added doctest fix for cross_validation.rst

* FIX: remove errors

* TST: tests updated and default value changed to None

* TST: improve split tests

* FIX: reduce code length
2017-06-08 10:51:40 +02:00
Naoya Kanai 6579220588 [MRG+1] Drop NumPy < 1.8 (#8874) 2017-06-07 17:06:06 +02:00
Hanmin Qin 41b84f84cc [MRG+1] Change the restriction of n_repeats in RepeatedKFold and RepeatedStratifiedKFold (#8909)
* change the restriction of n_repeats

* change test case
2017-06-05 16:51:17 +02:00
Toshihiro Kamishima 754109c78d [MRG+1] enable to use get_n_splits of LeaveOneGroupOut and LeavePGroupsOut with dummy parameters (#8794)
* remove needless argument checking

* add parameter checking as in LeavePGroupsOut

* add examples with dummy inputs

* add unittest for a get_n_splits method in LeaveOneGroupOut and LeavePGroupsOut classes

* X and y can be ommited in a get_n_splits function.

* fix error messages

* update examples

* fix test for an error message

* Revert "fix test for an error message"

This reverts commit 68b984207c.

* fix test for an error message

* fix error messages

* remove tailing white spaces

* add periods to messages

* test for ValueError’s of get_n_splits methods of LeaveOneOut / LeavePOut classes

* fix documents:
* parameter name: group -> groups
* modfy white space
2017-05-12 14:56:13 +02:00
AishwaryaRK b57837188d [MRG] Fixes #8736 add get_n_splits for RepeatedKFold and RepeatedStratifiedKFold (#8802) 2017-04-29 21:33:32 +10:00
Guillaume Lemaitre e3c9ae204f [MRG+1] DOC improve description and consistency of random_state (#8689)
* DOC improve description of random_state in train_test_split

* DOC Make random_state consistent through documentation

* FIX reverse doc mistake

* FIX address comment of Tom

* DOC address comments

* DOC remove empty line

* DOC remove unecessary white spaces
2017-04-05 17:43:21 -07:00
Neeraj Gangwar af1796ef68 [MRG+1] Repeated K-Fold and Repeated Stratified K-Fold (#8120)
* Add _RepeatedSplits and RepeatedKFold class

* Add RepeatedStratifiedKFold and doc for repeated cvs

* Change default value of n_repeats

* Change input parameters of repeated cv constructor to n_splits, n_repeats, random_state

* Generate random states in split function rather than store it beforehand

* Doc changes, inheriting RepeatedKFold, RepeatedStratifiedKFold from _RepeatedSplits and other review changes

* Remove blank line, put testcases for deterministic split in loop and add StopIteration check in testcase

* Using rng directly as random_state param to create cv instance and added a check for cvargs

* Fix pep8 warnings

* Changing default values for n_splits and n_repeats and add entry in changelog

* Adding name to the feature

* Missing space
2017-03-04 15:39:04 -05:00
Joel Nothman 7e18252a9e COSMIT remove unused import (#7928) 2016-11-24 11:33:56 +11:00
Raghav RV 680a5b8a95 [MRG + 1] DOC Add whatsnew for the 3 model_selection bugfixes (#7868)
* DOC Add whatnew for the 3 mod-sel bugfixes

* Move to 0.18.1; Change name universally to Raghav RV

* Raghav R V --> Raghav RV

* Edit mailmap to include my other email
2016-11-15 11:25:41 +01:00
Raghav RV d7c956afc8 [MRG] FIX Validate and convert X, y and groups to ndarray before splitting (#7593) 2016-11-04 09:48:47 +11:00
Rafael Possas 304c67cab6 COSMIT delete untrue and obsolete comment 2016-11-02 00:39:57 +11:00