Commit Graph

93 Commits

Author SHA1 Message Date
Thomas Moreau d25da1be20 FIX make joblib utils private, and remove mentions of externals.joblib (#12345) 2018-11-20 10:53:52 +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
TakingItCasual f4e7d2b19a Converting http to https (3)... (#12302) 2018-10-05 18:50:31 +02:00
Nicolas Hug b725921832 [MRG] Created 'cross-validation estimator' entry in glossary (#11661)
* Created 'cross-validation estimator' in glossary and referenced it where
needed

* Addressed adrinjalali comments

* updated glossary entry

* updaed docstrings according to commets
2018-10-04 09:43:47 -04:00
Adrin Jalali 2ed18e00f7 [MRG] DOC Examples added to the rest of linear models (#11975) 2018-09-12 17:47:42 +10:00
Hanmin Qin 9b8fd0b0d0 DOC Correct default n_jobs & reference the glossary (#11808)
Also improves the glossary entry for n_jobs.
2018-08-18 19:57:10 +10:00
Olivier Grisel 40e6c43cb4
Joblib 0.12.2 (#11741)
* joblib 0.12.2

* Export _joblib's register_parallel_backend

* Use latest version of coverage
2018-08-03 12:34:25 +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
Joel Nothman 14e7c328df Restructure access to vendored/site Joblib (#11471)
In order to fix #11408, this swaps `joblib` and `_joblib`. It however, allows users to access joblib's `Memory` or `Parallel` functionality without accessing `sklearn.externals._joblib` by importing `Memory`, `Parallel`, etc. into `sklearn.utils`.
2018-07-17 18:02:11 +02:00
Olivier Grisel 174f4aea6e
[MRG] FIX SparseCoder with readonly parallel mmap (#11346) 2018-06-23 12:16:59 +02:00
Loïc Estève 55da79f5fd [MRG] MAINT: remove old scipy LBFGS scipy related code (#10716) 2018-02-28 09:00:34 +11:00
ksemb 77418a0275 MAINT Fix escape sequences that are deprecated in Python 3.6 (#10578)
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
2018-02-07 10:41:21 +11:00
Alexandre Gramfort f8b09ce4bf Fix omp non normalize (#10071)
* fix OMP when columns of X are not normalized
2017-11-17 08:42:47 +11:00
srajan paliwal 3d1b786546 [MRG] Fix LogisticRegression see also should include LogisticRegressionCV(#9995) (#10022) 2017-10-27 13:10:47 +02:00
(Venkat) Raghav, Rajagopalan b6f8865b0a [MRG + 1 (rv) + 1 (alex) + 1] Add a check to test the docstring params and their order (#9206)
* add automatic test of docstrings for function / method signatures using numpydoc
2017-07-11 18:42:10 +02:00
Arthur Imbert 89962f0c5b [MRG+1] _preprocess_data consistent with fused types (#9093)
* add test for _preprocess_data and make it consistent

* fix pep8

* add doc, cast systematically y in X.dtype and update test_coordinate_descent.py

* test if input values don't change with copy=True

* test if input values don't change with copy=True #2

* fix doc

* fix doc #2

* fix doc #3
2017-06-23 20:33:11 +05:30
Naoya Kanai bd0fc236e0 [MRG+1] MAINT drop SciPy < 0.13 (#8854)
Remove sklearn.utils.fixes functions that are not needed for scipy >= 0.13 and keep deprecated wrappers in other modules.
2017-06-02 23:36:33 +02:00
Samuël Weber ec4def81d9 [DOC] Modify default normalize from False to True for some linear model (issue #1650) (#8640) 2017-03-30 07:12:22 -04:00
Lee Murray d196ea3cc5 [MRG] DOC: improve docstring form 'normalize' (#8658)
* DOC: improve docstring form 'normalize'

* DOC: improve docstring for 'normalize'

* fix double backticks in coordinate descent

* add missing path reference

* fix line lengths

* align language in docstring across files in linear_model
2017-03-30 11:19:21 +02:00
John Wei 5ce43f6eda DOC Fix output shape in doc for OrthogonalMatchingPursuit (#8091) 2016-12-20 22:06:15 +11:00
Joel Nothman 8570622a44 [MRG+1] DOC insert spaces before colons in parameter lists (#7920)
* DOC insert spaces before colons in parameter lists

Complies with numpydoc to improve rendering and automatic quality
assurance such as #7793. Affects listings of Parameters Attributes,
Returns.

Performed with the help of:

    grep -nE '^(    )+[a-zA-Z][a-zA-Z0-9_]*: ' sklearn -R | grep -v -e
    externals -e tests | grep -v -e default: -e else: -e Warning: -e Note:
    -e TRAIN: -e Default: -e True: -e False: -e DOI: -e In: | gsed
    's|\([^:]*\):\([0-9]*\):\([^:]*\):\(.*\)|--- a/\1\n+++ b/\1\n@@ -\2,1
    +\2,1 @@\n-\3:\4\n+\3 :\4|' | git apply --unidiff-zero -

* DOC fix numpydoc format for param
2016-11-25 10:59:22 +01:00
Mathieu Blondel f122efa151 Fix typo in OMP author name.
First author is Stéphane Mallat.
2016-10-23 17:54:58 +09:00
YenChenLin 46fc1be145 Remove redundant words in sklearn 2016-02-23 16:54:03 +08:00
giorgiop 140a5acda8 MAINT depr of center_data, normalize in linear_model 2016-02-17 14:26:50 -05:00
Andreas Mueller fb123ed24b More doc fixes. Latex builds again. 2015-11-20 16:30:45 -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
Olivier Grisel f1c5924b36 ENH better error message for estimators with ensure_min_* checks 2015-10-01 14:44:05 +02:00
Raghav R V 882c346abd DOC Make cv documentation consistent across our codebase 2015-09-10 09:15:13 +05:30
Vighnesh Birodkar 2f099334f9 MAINT deprecate 1d input arrays for all estimators
Passing 1D arrays to check_array, without setting `ensure_2d` to false now
raises a deprecation warning before reshaping it. This will later throw an
error.

All Scaler classes also throw warnings when 1D arrays are passed.

All unit tests/doctests are modified to ensure that no 1D arrays are passed,
except in explicit 1D array tests where the warnings have been silenced.

Additional tests are also included which check for different 1D array cases.

2D array tests with one samples and one features are also added and where
they failed, `check_array` call has been modified to give a more useful error
message
2015-09-09 15:49:58 +02:00
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
Olivier Grisel f4366d5d36 FIX Gram OMP check_finite on old scipy 2015-05-20 11:38:38 +02:00
Andreas Mueller 211f204767 fix ompcv on old scipy versions 2015-03-18 10:25:01 -04:00
Andreas Mueller cd5166e82f make check_array convert object to float.
fix dtype check, add test. unfriend all multi-output estimators on facebook.

try to fix what is happening to y (by doing nothing to y)

make test work...

Make everything accept object y or say "invalid label"

fix multioutput linear models

add test for sensible error message.
2015-02-15 12:13:41 -05:00
Andreas Mueller e3e0827243 FIX check (and enforce) that estimators can accept different dtypes. 2015-02-10 15:37:15 -05:00
Andreas Mueller c970fb51e7 COSMIT spelling 2015-01-15 15:09:35 -05:00
trevorstephens 7c50e6c8eb various docstring fixes for web docs 2014-11-30 17:59:42 -08:00
Raghav R V 4a8c7a789c Fixes #3644 2014-11-25 23:24:54 +05:30
Joel Nothman b3bdb08964 DOC fix formatting of attributes etc. in docstrings 2014-07-28 19:04:59 +10:00
MechCoder d72ca5974f Added n_iter attribute to OMP (and CV) 2014-07-22 15:09:39 +02:00
Andreas Mueller 6e2a83b4e1 remove check_arrays stuff and old input validation 2014-07-20 13:31:45 +02:00
lesteve 7236ade3f0 Tidy up by removing unnecessary local variables 2014-07-17 16:32:19 +01:00
lesteve 259936599a Remove 'copy_X', 'copy_Gram' and 'copy_Xy' documentation since these parameters have been removed 2014-07-17 15:23:18 +01:00
lesteve 7d905b8c5a Remove deprecated 'Gram' and 'Xy' parameters from OrthogonalMatchingPursuit.fit 2014-07-17 10:23:28 +01:00
lesteve 0a953a1187 Remove deprecated 'copy_Gram', 'copy_Xy' and 'copy_X' parameters 2014-07-17 09:59:42 +01:00
lesteve 7b69ace3e1 Remove deprecated 'precompute_gram' parameter 2014-07-17 09:47:07 +01:00
Andreas Mueller d12d3132c4 Fix some fun column span alignment errors. 2014-06-07 16:48:48 +02:00
Gael Varoquaux 1b67fe33e5 MAINT: scipy 0.10 and 0.11
linalg.solve_triangular does not have a check_finite keyword argument
2014-03-03 23:51:38 +01:00
Gael Varoquaux dc27992c1a MAINT: remove our solve_triangular
No longer needed, since we depend on scipy >= 0.9
2014-03-03 20:25:33 +01:00
GaelVaroquaux dc8a03e958 BUG: fix convergence check in OMP 2013-11-29 17:52:19 +01:00