Commit Graph

131 Commits

Author SHA1 Message Date
Rüdiger Busche d300f406ae MAINT Simplify super() calls (#12812) 2019-01-10 22:27:06 +01:00
Wenhao Zhang 581752012c ENH refit=callable in *SearchCV adds flexibility in identifying the best estimator (#11354) 2019-01-09 12:56:30 +11: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
Roman Yurchak acb8106472 MNT Use list and dict comprehension (#12668) 2019-01-08 09:32:34 +11:00
Hanmin Qin 6dd6af78eb TST Use match instead of message in pytest.raises (#12933) 2019-01-07 15:20:11 +01:00
Roman Yurchak 684d8a221d MAINT Use set litterals when possible (#12667) 2019-01-06 19:21:45 +08:00
Andreas Mueller 952ef6637a MRG Drop legacy python / remove six dependencies (#12639) 2019-01-03 15:50:05 +02: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
Bartosz Michałowski fa98a72dcc MNT Replaced all occurrences of assert_true and assert_false with assert (#12588) 2018-11-28 09:16:26 +08:00
Hanmin Qin 69c5dd9d85 TST Specify random seed in test_shuffle_kfold_stratifiedkfold_reproducibility (#12674) 2018-11-27 21:17:49 +01:00
Marc Torrellas f6f7e3cfd3 [MRG + 2] Print train scores in _fit_and_score (#12613)
* print train scores when verbose > 3 in _fit_and_score

* train_scores computed if verbose > 3, and 3 decimals places only

* flake8 warnings solved

* print train score if return_train_score
test coverage increased

* added test for multimetric;
tests cleaned using pytest parametrize

* fixing failed tests for python2...

* revert changes in _scorer

* modified whats_new

* modified whats_new again
2018-11-21 20:22:24 -05:00
Yaroslav Halchenko 362cb3bcab TST autoreplace assert_true(...==...) with plain assert (#12547) 2018-11-11 09:05:34 +08:00
Nicolas Hug 4e2da4af92 [MRG] Added FutureWarning in sgd models for tol parameter (#12399)
* Added ChangedBehaviorWarning in sgd models

if tol is None while max_iter is set

* Changed to FutureWarning and clarified None meaning

* Ignored warningin tests

* Ignore warnings in tests, round 2
2018-10-24 11:00:43 -04:00
Andreas Mueller 0f94f2962b
MNT simple deprecations and removals for 0.21 (#12238)
Part of #11992.
These were all the things that seemed pretty straight-forward. It's actually a bit bulky but should still be easy to review, hopefully.
2018-10-11 14:56:37 -04:00
Andreas Mueller fb7be879a3 [MRG + 1] return_train_score deprecation (#12241) 2018-10-03 19:24:14 +02:00
Adrin Jalali 239482ffdf BaseSearchCV._run_search raises NotImplementedError instead of being an abstractmethod (#12182)
* _run_search raises NotImplementedError instead of being and abstractmethod

* add error message

* test for a BaseSearchCV child w/o a _run_search

* make the test python2 compatible, still in 0.20 zone.

* specify cv in tests not to trigger the related FutureWarning

* PEP8
2018-09-28 13:49:58 -04:00
Hanmin Qin b915ca6fd8
MNT Avoid using "is" when comparing strings (#12168) 2018-09-26 14:32:09 +08:00
Guillaume Lemaitre 5431a1a9bf BUG: check equality instead of identity in check_cv (#12155) 2018-09-25 19:00:27 +08:00
Roman Yurchak ec69171d52 TST Use pytest.raises instead of legacy constructions (#12057) 2018-09-13 13:57:43 +02:00
Adrin Jalali 36536c6f46 MAINT Fix invalid escape sequence (#12064) 2018-09-13 17:08:23 +08:00
William de Vazelhes a0418215fe TST FIX use match rather than message in pytest.raises (#12001)
Previously these assertions would pass without matching.
2018-09-05 07:36:15 +10:00
Joel Nothman 7ed61a24fe ENH add multi_class='auto' for LogisticRegression, default from 0.22; default solver will be 'lbfgs' (#11905)
* Change default solver in LogisticRegression
* This is an API change, not a feature
* Decrease numerical precision in LogisticRegression doctest
* ENH add multi_class='auto' for LR, default from 0.22
* No warning when binary
2018-08-26 23:00:02 +03:00
Hanmin Qin 5533deb8e0 [MRG] FIX Support cv=None in *CV (#11761) 2018-08-07 11:53:59 +10:00
Joel Nothman 477c921c0f
ENH extending BaseSearchCV with a custom search strategy (#9599) 2018-08-06 08:18:48 +10:00
Samuel O. Ronsin 6b38970fce ENH Expose errors_score in cross_validate and cross_val_score (#11583) 2018-07-27 12:27:16 +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
Andreas Mueller 8e2c2aa35d
raise DeprecationWarnings and FutureWarnings as errors (#11570)
Towards #11252.
In the end we'd like to make these errors so we can keep this cleaner in the future.
2018-07-17 15:31:45 -05: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
Gael Varoquaux 106bb9e7f5 MAINT: option to unvendor joblib (#11166) 2018-06-29 16:35:45 +02:00
Andreas Mueller eec7649236 MAINT Complete 0.20 deprecations (#9570) 2018-06-24 23:06:26 +10:00
jeremiedbb 0d8a04bd17 [MRG+1] SimpleImputer(strategy="constant") (#11211) 2018-06-20 17:20:33 +02:00
Matthias Feurer 768ff4d1b7 ENH Add refit_time_ attribute to model selection (#11310) 2018-06-20 12:51:37 +10:00
Roman Yurchak e8d8b8eeb0 TST: parametrize unit tests (#11074)
yield tests are deprecated in pytest and will be removed in pytest 4.0.
They all have been replaced by parametrize.
2018-06-08 14:59:33 +02:00
SolutusImmensus b4984e27db [MRG+1] FIX Add some validation in the constructor of ParameterGrid (#11090) 2018-05-25 10:38:46 +02:00
Ming Li 7124d87dca [MRG+1] more explicit error message when multiple scores passed (#11008) 2018-04-22 14:11:43 +02:00
julietcl e070611bdb [MRG+1] Fix [RandomizedSearchCV] Do not enforce that n_iter is less than or equal to size of search space (#10982) 2018-04-20 11:44:03 +02:00
Alexandre Sevin cd76f9b780 [MRG + 2] Add convergence warning to linear models (#10881)
Make convergence warnings appear when verbose = 0 in liblinear models.
2018-04-02 22:52:50 +10:00
Gaurav Dhingra eed83790b0 ENH Change default gamma from 'auto' to 'scale' in SVC (#10331) 2018-03-10 10:39:21 +08:00
Kirill b7f9dad5d7 TST Check that test_score ranked correctly when error_score is np.nan (#10714) 2018-03-04 22:47:44 +08:00
Kirill 76b5b2af57 ENH Change default error_score to raise-deprecating (#10677) 2018-03-02 18:32:42 +11:00
Aurélien Bellet d9c212297e ENH add option to cross_validate to return estimators fitted on each split (#9686) 2018-02-28 09:32:46 +11:00
Kumar Ashutosh 71b29acbfb [MRG+2] Moves Imputation out of Preprocessing (#10483) 2018-02-15 06:47:06 +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
Hanmin Qin ab4a8b4a87 remove redundant code (#10563) 2018-01-31 19:42:15 +01:00
Mayur Kulkarni 92c9095591 [MRG+1] FIX Improve message and exception of cross-validation FitFailedWarning (#10382) 2018-01-10 16:20:05 -08:00
Andreas Mueller 4321002934 API deprecate *SearchCV iid parameter (#9379) 2017-12-12 09:30:27 +11:00
Joel Nothman 85d670c3b1 Duplicate import 2017-10-20 18:17:11 +11:00
Reiichiro Nakano ebc8730344 [MRG+1] Fix cross_val_predict behavior for binary classification in decision_function (Fixes #9589) (#9593)
* fix cross_val_predict for binary classification in decision_function

* Add unit tests

* Add unit tests

* Add unit tests

* better fix

* fix conflict

* fix broken

* only calculate n_classes if one of 'decision_function', 'predict_proba', 'predict_log_proba'

* add test for SVC ovo in cross_val_predict

* flake8 fix

* fix case of ovo and imbalanced folds for binary classification

* change assert_raises to assert_raise_message for ovo case

* fix flake8 linetoo long

* add comments and clearer tests

* improve comments and error message for OvO

* fix .format error with L

* use assert_raises_regex for better error message

* raise error in decision_function special cases. change predict_log_proba missing classes to minimum numpy value

* fix broken tests due to special cases of decision_function

* add modified test for decision_function behavior that does not trigger edge cases

* fix typos

* fix typos

* escape regex .

* escape regex .

* address comments. one unaddressed comment

* simplify code

* flake

* wrong classes range

* address comments. adjust error message

* add warning

* change warning to runtimewarning

* add test for the warning

* Use assert_warns_message rather than assert_warns

Other minor fixes

* Note on class-absent replacement values

* Improve error message
2017-10-19 17:05:43 -04:00