Commit Graph

69 Commits

Author SHA1 Message Date
Jérémie du Boisberranger bb5ab53f94
API Config: change default display to "diagram" (#22856) 2022-03-21 15:43:07 +01:00
Guillaume Lemaitre 229bd226ab
MNT remove _pairwise attribute (#21594) 2022-02-09 16:58:01 +01:00
Thomas J. Fan 9f85c9d449
TST Better info when checking for no warnings in tests (#22362) 2022-02-03 11:42:48 +01:00
Jérémie du Boisberranger a9bf7f38d7
FIX delete feature_names_in_ when refitting on a ndarray (#21389)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-10-23 12:30:05 +02:00
Thomas J. Fan 416898b7f4
ENH Adds Column name consistency (#18010)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2021-08-17 14:48:21 +02:00
Thomas J. Fan 3ae7c76153
STY Enables black with experimental_string_processing=true (#20412) 2021-06-29 09:47:04 +02:00
Felipe Rodrigues 6835cb3399
TST Remove `assert_warns_message` from `test_base` and `test_dummy` (#20388) 2021-06-27 09:42:15 -04:00
Thomas J. Fan 82df48934e
MNT Applies black formatting to most of the code base (#18948) 2021-06-17 14:21:09 -04:00
Alihan Zihna 7bb3e22b3c
TST change load_boston in test_base to make_* (#20174)
Co-authored-by: maikia <maja_ka@hotmail.com>
Co-authored-by: Alihan Zihna <a.zihna@ckhgbdp.onmicrosoft.com>
2021-05-31 15:36:23 -04:00
Thomas J. Fan d996eaf088
ENH Adds _num_features for array-likes (#19633)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
2021-03-16 15:14:25 +01:00
Alihan Zihna 1000d0a61b
TST replace assert_raise with pytest.raises in test_base.py (#19500)
Co-authored-by: Alihan Zihna <a.zihna@ckhgbdp.onmicrosoft.com>
2021-02-22 16:25:34 +01:00
Guillaume Lemaitre 2218ec4622
MNT change 0.25 to 1.0 and 0.26 to 1.1 in deprecation messages (#19005)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2020-12-18 16:09:19 +00:00
Guillaume Lemaitre 255718b4ad
introduce _safe_tags for estimator not inheriting from BaseEstimator (#18797)
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2020-12-02 11:18:53 +01:00
Juan Carlos Alfaro Jiménez 1864ed442e
MNT Raise error if parameter cannot be retrieved (#17448)
* MNT Raise error if parameter cannot be retrieved

* MNT Prefer pytest.raises over assert_raises_regex

* FIX Fix tests

* DOC Add what's new entry
2020-10-28 19:05:15 +01:00
Thomas J. Fan 02fa8f1adb
ENH Deprecates _pairwise attribute and adds pairwise to estimator tags (#18143) 2020-10-07 21:53:36 +11:00
Thomas J Fan f23b940dca
FIX Adjusts html_repr based on configuration (#17093)
* ENH Adjusts html_repr based on configuration

* CLN Returns None instead

* CLN Uses property hack

* CLN Address comments
2020-05-05 09:58:10 +02:00
Thomas J Fan ee2508ce45
ENH Adds HTML visualizations for estimators (#14180) 2020-04-30 08:31:58 +10:00
Nicolas Hug 964c830328
MNT Change print_changed_only default to True (#17061) 2020-04-27 18:22:21 -04:00
olicairns 3ae671e07b ENH Improve error message in clone when passed class instances (#16189) 2020-01-27 09:21:09 +01:00
Nicolas Hug 4256542b10 MNT Removed deprecated attributes and parameters (#15803) 2019-12-09 22:17:06 +08:00
Nicolas Hug b92455a6b2 MAINT Deprecate all of utils.testing except all_estimators (#15367) 2019-10-28 17:28:56 +01:00
Thomas J Fan dba753a200 API Auto generates deprecation for sklearn.utils.mocking (#15071) 2019-10-03 00:09:28 +10:00
Andreas Mueller 03ea20db0f Fix mixin inheritance order, allow overwriting tags (#14884) 2019-09-05 10:13:30 +02:00
Joel Nothman 0279108bef
API don't default get_params output to None in the future (#14464) 2019-07-28 23:37:47 +10:00
Adrin Jalali 19c068a2ec MNT towards removing assert_equal, etc (#14222) 2019-07-01 09:13:32 -04:00
Hanmin Qin 8f35843d98
MNT Update deprecation message in RegressorMixin.score to tell users how to avoid the warning (#13477) 2019-03-29 15:22:03 +08:00
Hanmin Qin 85206250ce DOC Typo metric.make_scorer -> metrics.make_scorer 2019-03-15 20:42:59 +08:00
Hanmin Qin 73e2ecf7ce
API Change default multioutput in RegressorMixin.score to keep consistent with metrics.r2_score (#13157) 2019-03-15 17:47:50 +08:00
Andreas Mueller ab2f539a32 API: Estimator tags (#8022) 2019-02-23 22:54:41 +01:00
Roman Yurchak 0e3bb17e62 MAINT Run pyupgrade following Python2 deprecation (#12997) 2019-02-08 20:13:34 +08:00
Rüdiger Busche d300f406ae MAINT Simplify super() calls (#12812) 2019-01-10 22:27:06 +01:00
Nicolas Hug a50c03f975 [MRG] Add pprint for estimators - continued (#11705)
* add pprint for estimators

* strip color from length, add color option

* Minor cleaning, fixes, factoring and docs

* Added some basic tests

* Fixed line length issue

* fixed flake8 and added visual test for review

* Fixed test

* Fixed Python 2 issues (inspect.signature import)

* Trying to fix flake8 again

* Added special repr for functions

* Added some other visual tests

* Changed _format_function in to _format_callable

because callable() returns True also for class objects (which we want to
reprensent with their name as well anyway)

* Consistent output in Python 2 and 3

* WIP

* Now using the builtin pprint module

* pep8

* Added changed_only param

* Fixed printing when string would fit in less than line width

* Fixed printing of steps parameter

* Fixed changed_only param for short estimators

* fixed pep8

* Added some more description in docstring

* changed_only is now an option from set_config()

* Put _pprint.py into sklearn/utils, added tests

* Added doctest NORMALIZE_WHITESPACE where needed

* Fixed tests

* fix test-doc

* fixing test that passed before....

* Fixed tests

* Added test for changed_only and long lines

* typo

* Added authors names

* Added license file

* Added ellipsis based on number of elements in sequence + added increasinly aggressive repr strategies

* Updated whatsnew

* dont use increaingly aggressive strategy

* Fixed tests

* Removed LICENSE file and put license text in _pprint.py

* fixed test_base

* Sorted parameters dictionary for consistent output in 3.5

* Actually using OrderedDict...

* Addressed comments

* Added test for NaN changed parameter

* Update whatsnew

* Added example to set_config()

* Removed example

* Added example in gallery

* Spelling
2018-12-19 23:48:21 -05: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
Peter 24e46410bd FIX: clone behavior for estimator types (#12585)
Fixes #12521
2018-11-15 07:59:09 +11:00
Yaroslav Halchenko 362cb3bcab TST autoreplace assert_true(...==...) with plain assert (#12547) 2018-11-11 09:05:34 +08:00
Andreas Mueller eec7649236 MAINT Complete 0.20 deprecations (#9570) 2018-06-24 23:06:26 +10:00
Joel Nothman 102620f8d1 [MRG] FIX bug in nested set_params usage (#9999) 2017-10-25 15:23:41 +02:00
Andreas Mueller 75763cfe78 FIX _BaseComposition._set_params with nested parameters (#9945) 2017-10-19 08:40:44 +11:00
Andreas Mueller 156a1f37a9 remove modification of warning registry for no reason (#9569) 2017-09-08 17:29:36 +02:00
(Venkat) Raghav, Rajagopalan 763d93b72e [MRG+1] Do not transform y (#9180)
* we do not transform y

* more

* added Deprecation Warning to transform() to remove Y parameter

* more

* ENH ensure FunctionTransformer's transform/inverse_transform doesn't permit y

* Undo changes to pls_. It will be done in a separate PR (see #9160)

* flake8

* Update whatsnew

* Fully undo PLS changes
2017-06-22 23:24:12 +02:00
zxcvbnius 54e89511b8 [MRG+1] Fix test of SingleInheritanceEstimator to not raise DeprecationWarning (#8526)
* Fix test of SingleInheritanceEstimator to not raise DeprecationWarning

* [MRG+1] Fix test of SingleInheritanceEstimator to not raise DeprecationWarning (#8526)

Fix: test of SingleInheritanceEstimator to not raise DeprecationWarning (#8526)

- Ignore a DeprecationWarning about unpickling an estimator from a different version

* [MRG+2] Fix test of SingleInheritanceEstimator to not raise DeprecationWarning (#8526)

Fix: test of SingleInheritanceEstimator to not raise DeprecationWarning (#8526)

  - Test of SingleInheritanceEstimator would raise UserWarning, not DeprecationWarning
  - Ignore a UserWarning about unpickling an estimator from a different version
2017-03-31 19:20:49 -04:00
Holger Peters 4493d37058 [MRG+1] Fix pickling bug due to multiple inheritance & __getstate__ (#8324)
Fixes #8316


* Don't use test classes to group tests

* only use formatting for parts of the string that change

* Flake 8 column limit

* Make the modification of the estimator more explicit in the tests

* As suggested in code review, prefer formatting over two literals

* Also assert, that __setstate__ overwriting works in mixin

* Remove cache property

* Use assertion functions from sklearn.utils.testing

* remove the protocol argument in tests

* Rename attributes to better convey their purpose

* Revert change of module in TreeNoVersion

* Adhere to column-limit

* changelog entry

* Fix commit message
2017-02-21 09:33:28 +11:00
Loïc Estève e5bf61eee1 [MRG+1] Dropping python 2.6 support (#7890)
* Remove Python 2.6 support

Some details about some slightly orthogonal changes:
* Note about cheking safely for nan is likely not valid any more (commit
  introducing it is c80ca91b)
* scipy.linalg.qr econ parameter removed since scipy 0.9 in favour of
  mode='economic'
* Remove unnecessary libgfortran in conda create command

* Putative fix by setting the random seed

* Revert unintended change

* Reinstate previous logic for checking for NaNs

* Reinstate change in error message

Error messages from Python 2.7 assertRegexp does not contain the
function name, in contrast with Python 3 assertRegex
2016-11-23 17:11:04 -05:00
Andreas Mueller 2e5c102454 make pickle version test more stable (#7415) 2016-09-13 22:36:08 +02:00
Andreas Mueller b4872fe30d [MRG] add warning when importing old or new pickle. (#7248) 2016-09-10 14:17:42 +02:00
Andreas Mueller 680ab517df [MRG + 2] remove complicated equality checks in clone as __init__ shouldn't touch anything. (#5540)
* BF: issue 5522 (cloning objects with pandas.Dataframe attributes)

* super conservative fix, pending GP and VBGMM fixes.

* TST improved test for df param

* add deprecation warning, add whatsnew entry

* fixed place of deprecation warning, added test for deprecation warning.

* pep8

* fix whitespace error
2016-09-08 10:07:11 +10:00
Preston Parry 58b35d8b9f DOC Updates sklearn naming convention for consistency (#7268)
* Updates sklearn naming convention for consistency

* minor grammar fix

* clarifies source of string vs. function cosine
2016-08-29 08:20:13 +10:00
Loïc Estève ccefc2ec32 Fix sklearn.base.clone for all scipy.sparse formats (#6910) 2016-06-21 23:24:42 +10:00
jackmartin e04755129f pep8
fixed whitespace
2016-06-10 18:55:05 -04: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