Commit Graph

279 Commits

Author SHA1 Message Date
Olivier Grisel 548a4524b4
MNT n_features_in_ consistency in decomposition (#18557)
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
2020-10-08 09:47:24 -04:00
Thomas J. Fan 8731cd732b
ENH Uses _validate_data in other methods in the neural_network module (#18514) 2020-10-07 11:35:47 +02:00
Nicolas Hug 5721629fd3
MNT Use a pytest-like context manager in estimator_checks.py (#18418) 2020-09-28 15:05:43 -04:00
Nicolas Hug 1dedc7e6a8
[MRG] Prototype 4 for strict check_estimator mode (#17361) 2020-08-06 12:02:15 +02:00
Nicolas Hug 4f5384b249
MNT Remove class support check estimator and parametrize_with_checks (#17134) 2020-05-10 17:11:39 -04:00
Nicolas Hug fc0041546a
Deprecate class support for check_estimator (#17032)
and parametrize_with_checks
2020-04-28 00:15:52 +02:00
Thomas J Fan a203b9e1c6
BUG Ignores tags when estimator is a class in parametrize_with_checks (#16709) 2020-03-19 00:22:28 +11:00
Roman Yurchak 1cbe59ee06
CI Check for unused imports when linting (#16678)
* Check for missing imports in linting

* Exclude externals

* Remove unused imports
2020-03-12 12:56:35 +01:00
Thomas J Fan 136ef79884
TST Checks can now skip test based on estimator tag _xfail_test (#16510) 2020-02-24 22:27:21 +01:00
Roman Yurchak 1c1f273d10
ENH XFAIL in common tests with estimator tags (#16502) 2020-02-20 22:28:54 +01:00
Roman Feldbauer 9b39c4c4d2
TST Fix unreachable code in tests (#16110) 2020-02-16 14:41:26 +01:00
Guillaume Lemaitre a5542e9490 BUG fix pip3 ubuntu update by suffixing file (#15928) 2019-12-20 11:11:20 -05:00
Thomas J Fan 4ce39dbc69 BUG Returns only public estimators in all_estimators (#15380) 2019-12-06 14:18:55 +01:00
Jérémie du Boisberranger 9876f748b0 [MRG] BUILD: warn instead of raise when openmp unsupported (#15174) 2019-11-13 10:03:12 +01:00
Olivier Grisel 82e2f54565 BLD: Do not pre-cythonize when calling sdist (#15567) 2019-11-08 13:04:30 +01:00
Nicolas Hug 19ad136223 MNT Replace DeprecationWarning with FutureWarning (#15080)
* bruteforce renaming

* WIP

* WIP

* some more

* removed weird line

* update -Werror

* testiforest

* again

* Fixed some tests

* fixed some tests

* removed -Werror

* fixed test_docstring_param issue

* fixed some tests

* some more

* renamed to SklearnDeprecationWarning

* pep8

* updated docs

* pep8

* merge

* changed to FutureWarning

* fixes

* Update doc/developers/tips.rst

Co-Authored-By: Adrin Jalali <adrin.jalali@gmail.com>

* avoid duplicates

* fixed warning for deprecations

* Still make CI break if DeprecationWarning isn't caught

* updated one warning

* fixed test

* fixed some renamings

* updated new dep warnings

* fixed bad import

* ignore warnings

* update again

* ignore futurewarning when walking packages

* Fixed test

* pep8

* Added whatsnew
2019-10-29 15:39:26 +01: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 bb3b3f9261 MNT Make modules private in feature_extraction (#15321) 2019-10-25 16:41:13 -04:00
Thomas J Fan 0a7adef005 MNT Make modules private in linear_model (#15324) 2019-10-23 15:34:26 +02:00
Nicolas Hug 14295f9ceb
MNT make files private for cluster module (#14948) 2019-10-14 12:29:08 -04:00
Nicolas Hug 70f9e9f76f MNT deprecate some more utils in estimator_checks.py (#15029)
* deprecated notanarray

* deprecated is_public_parameter

* deprecated pairwise_estimator_convert_X

* deprecated checking_parameters

* pep8

* use decorator for class
2019-09-20 11:35:08 +02:00
Guillaume Lemaitre bab5926024 FEA: Stacking estimator for classification and regression (#11047) 2019-09-19 06:06:33 +10:00
Thomas J Fan d9a12aa0a9 ENH Disassemble check estimator (#14381) 2019-08-28 09:07:28 +03:00
Thomas J Fan 530be8f442 [MRG] MAINT check_estimator raises SkipTest when _require_para… (#14522) 2019-08-07 13:00:57 -04:00
Andreas Mueller b162acaa13 MAINT Slight common tests cleanup (#14511) 2019-07-30 10:39:16 -04:00
Guillaume Lemaitre 5925fb9e4f [MRG] FIX run test for meta-estimator having estimators keyword (#14305)
* TST run test for meta-estimator having estimators keyword

* TST check the target when classifying

* raise warning for 2d array in regression

* always convert to 2D array before average

* DOC add whats new

* iter

* iter

* address comments Nicolas

* iter

* remove parameter for VotingClassifier

* move tests into ensemble voting

* PEP8
2019-07-29 15:01:49 -04:00
Adrin Jalali 19c068a2ec MNT towards removing assert_equal, etc (#14222) 2019-07-01 09:13:32 -04:00
Roman Yurchak 0eedf99eee MAINT Don't use clean_warnings_registry in tests (#14085) 2019-06-17 14:10:05 +02:00
Guillaume Lemaitre b34751b7ed [MRG] MAINT: add fixture for init and clean-up with matplotlib (#13708) 2019-05-06 09:41:46 +02:00
jeremiedbb 0fb7cc7520 BLD: check OpenMP support and add a switch to build without it (#13543) 2019-04-17 08:29:37 +10: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
surgan12 62d2059804 MNT remove __future__ imports (#12791) 2019-02-02 22:05:06 +08: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
Joan Massich 6de7957d97 TST Ignore warnings in common test to avoid collection errors (#12093) 2018-09-17 09:53:31 +10:00
Ronan Lamy 5592a2eda9 [MRG] PyPy support for all but a couple of estimators (#11010) 2018-07-20 14:39:53 +10:00
Andreas Mueller 2f3cc078ea I swear it'll work now... maybe 2018-07-17 18:20:51 -05:00
Shangwu Yao cb1dbc25a7 MNT: reduce the number of warnings in test_common.py (#11151)
Improve handling of warning filters in sklearn.utils.testing by avoiding to reset warnings.filters.
2018-06-11 08:59:12 +02:00
Andreas Mueller 51fe7a52ad TST make parametrized tests with partial have better displayed names (#11132) 2018-05-24 21:52:50 +02:00
Roman Yurchak 67cc975f46 [MRG+1] MAINT Parametrize common estimator tests with pytest (#11063) 2018-05-07 12:12:55 +02:00
cclauss 79053af976 execfile(): Use feature detection, not version detection (#10532)
* Follows Python porting best practice of [use feature detection instead of version detection](https://docs.python.org/3/howto/pyporting.html#use-feature-detection-instead-of-version-detection).  
 * Remove execfile() call in both Python 2 & Python 3
2018-01-25 23:11:13 +01:00
RAKOTOARISON Herilalaina 72fb54c767 [MRG+1] - No private setting in __init__ apart from parameters (#9450) 2017-12-13 12:19:56 +01:00
Loïc Estève a13a7d8d20 MAINT remove _named_check (#10160)
which was a nose-specific thing to have good names for tests using yield
2017-11-17 12:37:29 -05:00
FarahSaeed b2723582f2 [MRG] DOC Replacing "the scikit" with "scikit-learn" (#10126) 2017-11-14 11:06:50 +01:00
Andreas Mueller d788dcb199 [MRG+1] Instance level common tests (#9019)
* start work on separating instance-level tests

* minor refactoring / fixes to work without tags

* add clone into check_supervised_y_2d estimator check (which made other checks fail)

* remove duplicate check_estimator_unfitted assert

* add issue reference to whatsnew entry

* added some clones, minor fixes from vene's review

* rename estimator arg to estimator_org to make a visible distinction before and after cloning.

* more renaming for more explicit clones

* org -> orig

* allclose, fix orig stuff

* don't use set_testing_parameters in the checks!

* minor fixes for allclose

* fix some test, add more tests on classes

* added the test using pickles.

* move assert_almost_equal_dense_sparse to utils.testing, rename to assert_allclose_sparse_dense, test it

* make assert_allclose_dense_sparse more stringent

* more allclose fixes

* run test_check_estimator on all estimators

* rename set_testing_parameters to set_checking_parameters so nose doesn't think it's a tests (and I don't want to import stuff from nose as we want to remove it)

* fix in set_checking_parameters so that common tests pass

* more fixes to assert_allclose_dense_sparse

* rename alg to clusterer, don't scream even though I really want to

* ok this is not a pretty strict test that runs check_estimator with and without fitting on an instance. I also check if ``fit`` is called on the instance that is passed.

* simplify test as they didn't help at all

* it works!!! omfg

* run check_estimator clone test only on one of the configs, don't run locally by default

* Add `slow_test` decorator and documentation

* run test_check_estimator only on some estimators

* fix diags in test for older scipy

* fix pep8 and shorten

* use joblib.hash for inequality check because the pickle state machine is weird
2017-06-09 16:33:57 +02:00
Alexander Junge 568c002325 [MRG + 1] Move n_iter and get_params invariance tests to common estimator_checks (#7677)
* Test get_params invariance in common estimator tests

Remove test_get_params_invariance() from `test_common.py` and add
test call to _yield_all_tests() in `estimator_checks.py` to make
sure that get_params(deep=False) of a given Estimator returns a
subset of get_params(deep=True).

Compared to test_get_params_invariance(), it is NOT tested anymore
whether the given Estimator has an attribute get_params since
class BaseEstimator in `base.py` defines such an attribute
for each Estimator.

Partially addresses issue #7533
Also related to issue #4465

* Move test_transformer_n_iter() to estimator_checks.py

Remove the test test_transformer_n_iter() from tests/test_common.py
and perform the test logic in utils/estimator_checks.py instead.
Specifically, the method _yield_transformer_checks() now yields
check_transformer_n_iter() as part of the set of tests for
transformers.

test_transformer_n_iter() tests that that transformers with an
attribute max_iter, return the attribute of n_iter at least 1.

Partially addresses latter part of issue #7533

* Move test_non_transformer_estimators_n_iter() to estimator_checks.py

Remove the test_non_transformer_estimators_n_iter() from
tests/test_common.py; perform the test logic in
utils/estimator_checks.py instead.
Specifically, the method _yield_non_meta_checks() now yields
check_non_transformer_estimators_n_iter().

test_transformer_n_iter() tests that that estimators that are not
transformers with an attribute max_iter, return the attribute n_iter
of at least 1.

NOTE: The current implementation makes said test run for more
estimators than before this commit.
For some of these estimators, the test fails. This needs to be addressed
(see FIXME in line 111-115 of utils/estimator_checks.py for a potential
place to start).

Partially addresses latter part of issue #7533

* Fix check_non_transformer_estimators_n_iter calls

test_transformer_n_iter() test is now only run for
estimators where the test is applicable.

Partially addresses latter part of issue #7533

* Run check_non_transformer_estimators_n_iter on multi-class estimators

To do this, use helper method multioutput_estimator_convert_y_2d.
Also remove multi_output parameter from
check_non_transformer_estimators_n_iter since this parameter is not
used anywhere and corresponding cases should be handled by said
helper method.

Also, some pep8 line length fixes.

* Fix documentation for n_iter tests

There was some confusion between attributes and parameters.
Also rename n_iter to n_iter_
2016-10-20 10:23:15 -04:00
Andreas Mueller 1dff0aec21 clean up deprecation warning stuff in common tests
minor fixes in preprocessing tests
2016-09-22 19:35:31 +05:30
Joel Nothman e222058dda Make named_check private 2016-09-16 06:46:50 +10:00
Joel Nothman 1578eddef4 TST move test naming and use inspect 2016-09-14 11:11:04 +10:00
Andreas Mueller 7fc41768b1 pep8 2016-08-31 22:37:23 -04:00