Commit Graph

57 Commits

Author SHA1 Message Date
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
Raghav RV 38f6a91566 [MRG + 2] FIX Be robust to non re-entrant/ non deterministic cv.split calls (#7660) 2016-10-31 08:49:17 +11:00
polmauri 73d3f03cfc [MRG + 1] FIX raise an error message when n_groups > number of groups (#7681) (#7683)
* FIX raise an error message when n_groups > actual number of groups (#7681)

This change addresses issue #7681:
- Raise ValueError when n_groups > actual number of unique groups in LeaveOneGroupOut and LeavePGroupsOut.
- Add unit test.

* Make requested changes

- Check error message with `assert_raise_message`
- Pass parameters to `assert_raise_message` instead of defining functions

* Update condition and exception message
2016-10-25 11:42:39 -04:00
Russell Smith 54b0e4bf62 Add OneVs{One,All}Classifier._pairwise: fix for #7306 (#7350) 2016-09-20 13:46:45 +02:00
Raghav RV 9a12555e6d [MRG+1] ENH/MNT Rename labels --> groups in CV tools (#6660) 2016-09-11 19:14:41 +02:00
Andreas Mueller 31a4691d76 [MRG+1] fix sampling in stratified shuffle split (#6472)
Fix sampling in stratified shuffle split, break tests that test sampling.
2016-09-09 19:00:49 +02:00
Yen a7d748b1de Rename `TimeSeriesCV` to `TimeSeriesSplit` (#7245)
* rename TimeSeriesCV to TimeSeriesSplit

* Add TimeSeriesSplit

* Add whats new
2016-08-26 12:34:33 +10:00
Yen 234d25677d [MRG] Add homogeneous time series cross validation (#6586) 2016-08-24 23:15:38 +10:00
Nelson Liu 07e0dd3068
removed versionadded for arrays param and fixed spacing 2016-08-17 16:58:08 -07:00
Nelson Liu 8b6753db58
remove accidentally added whitespace 2016-08-17 16:43:14 -07:00
Nelson Liu 24af423e8f
edit docstring for arrays argument as well 2016-08-17 16:41:38 -07:00
Nelson Liu 5856a2c863
clarify splitting sparse data always outputs csr matrix 2016-08-17 14:14:04 -07:00
Yen 42120e50bb [MRG+1] Rename CV params n_{folds,iter} to n_splits (#7187)
* Rename n_iter to n_splits

* Fix bug

* Fix examples

* Add spaces

* Rename n_folds to n_splits

* Fix error

* Fix doc

* Fix doc

* Fix example

* Rename variables name

* PEP8

* Fix error message

* Add whats_new

* Fix test

* Fix doc

* Fix doc

* Make test clear
2016-08-16 13:56:55 -07:00
Joel Nothman 617f0ca7b2 DOC fix Olivier's misspelt name 2016-08-14 23:51:33 +10:00
Yen f50790c9da DOC Add LabelKFold in _BaseKFold's docstring (#6344) 2016-08-10 13:58:57 +10:00
James Fiedler e4b837cc66 Removed unused imports 2016-07-29 19:30:23 -05:00
Francis T. O'Donovan fe03879cd3 Fix doc refs to StratifiedKFold and KFold (#6936)
Fix links to `StratifiedKFold` and `KFold` in docstrings.
2016-06-28 09:22:05 +02:00
Andreas Mueller 150afe646e Merge pull request #6379 from lesteve/fix-stratified-shuffle-split-train-test-overlap
[MRG+1] fix StratifiedShuffleSplit train and test overlap
2016-02-29 15:23:23 -05:00
Loïc Estève 07728d9308 FIX StratifiedShuffleSplit train and test overlap
in some edge cases and added test.

Fix was applied in both sklearn.model_selection and
sklearn.cross_validation.
2016-02-26 08:25:25 +01:00
YenChenLin 04f2857452 Remove redundant assignment of parameter shuffle 2016-02-13 11:31:01 +08:00
Tom Dupré la Tour a1860144aa Merge pull request #6328 from rvraghav93/model_selection_repr_fix
[MRG+2] FIX/NRT signature expects the init to not be a c-defined method (Py2.7)
2016-02-11 17:43:56 +01:00
Raghav R V c4e0ce668c FIX/NRT signature expects the init to not be a c-defined method (Py2.7) 2016-02-11 13:36:21 +01:00
Ramana.S 2dc389c18c doc:added multilabel y support for all splitters 2016-02-10 11:23:30 -05:00
YenChenLin 604e1e0c21 Fix check_cv error message 2016-02-06 16:45:00 +08:00
dsquareindia 61486862a7 SKF raises error if n_labels<n_folds for individual classes. Updated whats_new 2016-01-21 12:07:28 +05:30