Commit Graph

264 Commits

Author SHA1 Message Date
Okhlopkov Daniil Olegovich 4eca0c986e updated info for cross_val_score
added link to sclera.metrics.make_scorer
2016-03-14 23:13:11 +03:00
Rob Alexander 78721261b6 Corrected typos in cross_validation.KFold docstring 2016-03-01 06:26:52 -08: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
dsquareindia 61486862a7 SKF raises error if n_labels<n_folds for individual classes. Updated whats_new 2016-01-21 12:07:28 +05:30
Raghav R V 99c73a89e0 DOC Reworded cv documentation 2016-01-08 00:53:54 -05:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
Andreas Mueller fb123ed24b More doc fixes. Latex builds again. 2015-11-20 16:30:45 -05:00
Raghav R V de5bc4a8aa MNT 0.19 --> 0.20; As the model_selection changes will be released in 0.18 only 2015-11-07 23:52:51 +01:00
KamalakerDadi f2e35411fa Added more versions of 0.17 2015-11-04 00:02:52 +01:00
KamalakerDadi d3a8f85c55 Added more documentation of version adds 2015-11-03 23:57:19 +01:00
KamalakerDadi 2249daaea8 Version added for all new classes 2015-11-03 23:54:42 +01:00
Andreas Mueller 3b7ad17786 DOC polish documentation of output types of train_test_split, add change to 0.16 whatsnew. 2015-11-01 18:38:33 -05:00
Aditya Joshi c37c938a69 Update cross_validation.py 2015-11-01 18:16:02 -05:00
Raghav R V 3f8743f47b Main Commits - Major
--------------------

* ENH Reogranize classes/fn from grid_search into search.py
* ENH Reogranize classes/fn from cross_validation into split.py
* ENH Reogranize cls/fn from cross_validation/learning_curve into validate.py

* MAINT Merge _check_cv into check_cv inside the model_selection module
* MAINT Update all the imports to point to the model_selection module
* FIX use iter_cv to iterate throught the new style/old style cv objs
* TST Add tests for the new model_selection members
* ENH Wrap the old-style cv obj/iterables instead of using iter_cv

* ENH Use scipy's binomial coefficient function comb for calucation of nCk
* ENH Few enhancements to the split module
* ENH Improve check_cv input validation and docstring
* MAINT _get_test_folds(X, y, labels) --> _get_test_folds(labels)
* TST if 1d arrays for X introduce any errors
* ENH use 1d X arrays for all tests;
* ENH X_10 --> X (global var)

Minor
-----

* ENH _PartitionIterator --> _BaseCrossValidator;
* ENH CVIterator --> CVIterableWrapper
* TST Import the old SKF locally
* FIX/TST Clean up the split module's tests.
* DOC Improve documentation of the cv parameter
* COSMIT consistently hyphenate cross-validation/cross-validator
* TST Calculate n_samples from X
* COSMIT Use separate lines for each import.
* COSMIT cross_validation_generator --> cross_validator

Commits merged manually
-----------------------

* FIX Document the random_state attribute in RandomSearchCV
* MAINT Use check_cv instead of _check_cv
* ENH refactor OVO decision function, use it in SVC for sklearn-like
  decision_function shape
* FIX avoid memory cost when sampling from large parameter grids

ENH Major to Minor incremental enhancements to the model_selection

Squashed commit messages - (For reference)

Major
-----

* ENH p --> n_labels
* FIX *ShuffleSplit: all float/invalid type errors at init and int error at split
* FIX make PredefinedSplit accept test_folds in constructor; Cleanup docstrings
* ENH+TST KFold: make rng to be generated at every split call for reproducibility
* FIX/MAINT KFold: make shuffle a public attr
* FIX Make CVIterableWrapper private.
* FIX reuse len_cv instead of recalculating it
* FIX Prevent adding *SearchCV estimators from the old grid_search module
* re-FIX In all_estimators: the sorting to use only the 1st item (name)
    To avoid collision between the old and the new GridSearch classes.
* FIX test_validate.py: Use 2D X (1D X is being detected as a single sample)
* MAINT validate.py --> validation.py
* MAINT make the submodules private
* MAINT Support old cv/gs/lc until 0.19
* FIX/MAINT n_splits --> get_n_splits
* FIX/TST test_logistic.py/test_ovr_multinomial_iris:
    pass predefined folds as an iterable
* MAINT expose BaseCrossValidator
* Update the model_selection module with changes from master
  - From #5161
  -  - MAINT remove redundant p variable
  -  - Add check for sparse prediction in cross_val_predict
  - From #5201 - DOC improve random_state param doc
  - From #5190 - LabelKFold and test
  - From #4583 - LabelShuffleSplit and tests
  - From #5300 - shuffle the `labels` not the `indxs` in LabelKFold + tests
  - From #5378 - Make the GridSearchCV docs more accurate.
  - From #5458 - Remove shuffle from LabelKFold
  - From #5466(#4270) - Gaussian Process by Jan Metzen
  - From #4826 - Move custom error / warnings into sklearn.exception

Minor
-----

* ENH Make the KFold shuffling test stronger
* FIX/DOC Use the higher level model_selection module as ref
* DOC in check_cv "y : array-like, optional"
* DOC a supervised learning problem --> supervised learning problems
* DOC cross-validators --> cross-validation strategies
* DOC Correct Olivier Grisel's name ;)
* MINOR/FIX cv_indices --> kfold
* FIX/DOC Align the 'See also' section of the new KFold, LeaveOneOut
* TST/FIX imports on separate lines
* FIX use __class__ instead of classmethod
* TST/FIX import directly from model_selection
* COSMIT Relocate the random_state documentation
* COSMIT remove pass
* MAINT Remove deprecation warnings from old tests
* FIX correct import at test_split
* FIX/MAINT Move P_sparse, X, y defns to top; rm unused W_sparse, X_sparse
* FIX random state to avoid doctest failure
* TST n_splits and split wrapping of _CVIterableWrapper
* FIX/MAINT Use multilabel indicator matrix directly
* TST/DOC clarify why we conflate classes 0 and 1
* DOC add comment that this was taken from BaseEstimator
* FIX use of labels is not needed in stratified k fold
* Fix cross_validation reference
* Fix the labels param doc

FIX/DOC/MAINT Addressing the review comments by Arnaud and Andy

COSMIT Sort the members alphabetically
COSMIT len_cv --> n_splits
COSMIT Merge 2 if; FIX Use kwargs
DOC Add my name to the authors :D
DOC make labels parameter consistent
FIX Remove hack for boolean indices; + COSMIT idx --> indices; DOC Add Returns
COSMIT preds --> predictions
DOC Add Returns and neatly arrange X, y, labels
FIX idx(s)/ind(s)--> indice(s)
COSMIT Merge if and else to elif
COSMIT n --> n_samples
COSMIT Use bincount only once
COSMIT cls --> class_i / class_i (ith class indices) -->
perm_indices_class_i

FIX/ENH/TST Addressing the final reviews

COSMIT c --> count
FIX/TST make check_cv raise ValueError for string cv value
TST nested cv (gs inside cross_val_score) works for diff cvs
FIX/ENH Raise ValueError when labels is None for label based cvs;
TST if labels is being passed correctly to the cv and that the
ValueError is being propagated to the cross_val_score/predict and grid
search
FIX pass labels to cross_val_score
FIX use make_classification
DOC Add Returns; COSMIT Remove scaffolding
TST add a test to check the _build_repr helper
REVERT the old GS/RS should also be tested by the common tests.
ENH Add a tuple of all/label based CVS
FIX raise VE even at get_n_splits if labels is None
FIX Fabian's comments
PEP8
2015-10-23 17:28:08 +02:00
Arnaud Rachez 5db2adf93c MAINT Removed deprecated stuff. 2015-10-21 10:24:23 +02:00
Raghav R V e3afc0e8c9 MAINT move custom error/warning classes into sklearn.exceptions
ENH NonBLASDotWarning -> EfficiencyWarning; Improve error message
DOC Add exceptions module to modules/classes.rst
MAINT Move ConvergenceWarning, UndefinedMetricWarning et al into exceptions
MAINT Remove ChangedBehaviorWarning from base
DOC/FIX Improve DataConversionWarning's docstring
2015-10-19 22:35:35 +02:00
Jan Hendrik Metzen 51f01d6bc8 FIX cross_validation and pairwise_kernels treat GP kernels as special case 2015-10-19 18:07:11 +02:00
Gilles Louppe a4e4cf9875 FIX: remove shuffling in LabelKFold 2015-10-19 16:27:04 +02:00
Gilles Louppe 1f4bc26a02 FIX: Ensure correct LabelKFold folds when shuffle=True 2015-09-25 13:26:34 +02:00
Raghav R V 882c346abd DOC Make cv documentation consistent across our codebase 2015-09-10 09:15:13 +05:30
Gilles Louppe 410e7f2c2a ENH: remove unnecessary assignments 2015-09-08 07:52:12 +02:00
Gilles Louppe c769a65e15 COSMIT: variable names, documentation, etc 2015-09-07 10:08:17 +02:00
Gilles Louppe cf7bc7b035 ENH: rename to LabelKFold
COSMIT: doc, pep8, etc

Refactor code
2015-09-07 09:56:19 +02:00
Jean Kossaifi 6eb4028519 Added subject independent KFold
Changed SubjectIndependentKFold to DisjointGroupKFold

cosmetic changes  test (fix seed correctly, use assert_equal for
meaningful error messages)

Changed name to DisjointLabelKFold

Added example of use

FIX: whitespace related doctest failure

FIX: Python 2.6 requires the field numbers in print

FIX: change docstring to comment in test function

DOC: moved docstring from function to class

FIX: added call to parent class

FIX: error in calling the parent

DOC: fixed doctest

FIX: doctest

Cosmetic changes (minor refactoring)

Optimised code (use np.bincount)

Cosmetic: use samples instead of weight for clarity

Minor fix: removed shuffle parameter

Cosmetic

Use mergesort instead of quicksort for reproducibility.

Changed variable name 'y' to 'label'.

Added test for degenerate case where n_folds > n_labels.

Documented the requirement n_labels > n_folds.

DOC: improved description + added see also sections.

Fixed dtype of temporary arrays.

Improved test: check that one label is not in both test and training.

Added documentation for DisjoinLabelKFold.
2015-09-07 09:53:58 +02:00
Gael Varoquaux e2e5fbd8e1 Merge pull request #5201 from christophebourguignat/master
DOC Clarify random_state parameter in KFold() doc
2015-09-02 07:16:11 +02:00
Christophe Bourguignat b10e78edbf [DOC] Precision on random_state in KFold() doc
Without paying attention, we could think KFold(30, random_state=123)
and KFold(30, random_state=124) generated two different versions
2015-09-01 20:12:07 +02:00
Gael Varoquaux 364825ae67 Merge pull request #5194 from christophebourguignat/master
[MRG+1] DOC Updated documentation for cv parameter
2015-09-01 09:51:58 +02:00
Christophe Bourguignat 53c3530ba3 DOC Updated documentation for cv parameter (issue #4533)
Added « optional »
2015-08-31 23:18:15 +02:00
Christophe Bourguignat 1991c43923 DOC Updated documentation for cv parameter (issue #4533) 2015-08-31 23:09:10 +02:00
Brian McFee 21a966ae8a ENH: added LabelShuffleSplit cv iterator 2015-08-30 12:00:18 +02:00
Olivier Grisel ea42c55b7b PEP8 in cross_validation module + tests 2015-08-27 15:34:41 +02:00
Buddha Prakash 26d3323242 Remove redundant p variable 2015-08-26 16:15:02 +05:30
Buddha Prakash e35c90ceeb Use Inverted locations to reorder the predictions 2015-08-26 14:27:44 +05:30
Buddha Prakash 48adf8be7d Use a single vstack for concatenating all blocks in prediction matrix 2015-08-26 08:07:15 +05:30
Buddha Prakash aa2d6bfb5f Add check for sparse prediction in cross_val_predict 2015-08-26 07:37:12 +05:30
Raghav R V 62325cbb58 MAINT merge _check_cv into check_cv as indices argument is removed in 0.17 2015-06-08 16:37:03 +05:30
Andreas Mueller 0650d5502e DOC adding backlinks to docstrings 2015-06-03 00:24:04 -04:00
Andreas Mueller c5b395fb3e FIX / TST make cross_val_predict work on lists, test pass-through and compatibility with various input types. 2015-05-19 15:04:45 -04:00
Andreas Mueller 8fff05c3e8 Merge pull request #4438 from mbatchkarov/stratified_train_test_split
[MRG + 2] Stratified `train_test_split`
2015-05-09 17:31:14 -04:00
Miroslav Batchkarov 52244dc6df incorporated amueller's feedback 2015-04-24 10:08:19 +01:00
Immanuel Bayer 00409d746b DOC use standart X, y notation 2015-04-15 11:37:27 +02:00
Miroslav Batchkarov 6cd1cae830 using StratifiedShuffleSplit instead of StratifiedKFold
this resolves API incompatibility in 803dcc10a2
2015-03-24 09:07:03 +00:00
Miroslav Batchkarov 803dcc10a2 fixed issue when train_size < test_size for stratified 2015-03-23 19:44:51 +00:00
Miroslav Batchkarov 34c85ed995 [WIP] preliminary implementation of stratified train_test_split
Broken when train_size < test_size
2015-03-23 19:19:40 +00:00
Raghav R V bf5fd93f47 MAINT Remove the deprecated n_iterations from StratifiedShuffleSplit 2015-03-19 05:13:09 +05:30
Raghav R V 88759ba187 MAINT remove the deprecated n_iterations param 2015-03-19 04:14:24 +05:30
Andreas Mueller e1af92b640 remove cross_validation.Bootstrap 2015-03-18 14:51:37 -04:00
Andreas Mueller 6beacc3fb6 remove deprecated stuff from 0.17 2015-03-18 14:49:04 -04:00
Loïc Estève 67dcd99d82 TST fix tests with numpy 1.6.1
np.bincount raises an Exception with empty input arrays for numpy versions < 1.6.2
Add utils.fixes.bincount to tackle this issue and use it instead of np.bincount
2015-02-01 15:49:49 +01:00
Lars 17726d2481 Merge pull request #4141 from amueller/bootstrap_int_one_fix
[FIX] Bootstrap with test_size=1 fix
2015-01-24 15:24:18 +01:00