Commit Graph

157 Commits

Author SHA1 Message Date
Joel Nothman 477c921c0f
ENH extending BaseSearchCV with a custom search strategy (#9599) 2018-08-06 08:18:48 +10:00
Nicolas Hug 72b2ed9ee1 DOC Added docstring checks for dataset module (#11407) 2018-07-24 10:57:13 +10:00
Nicolas Hug 6d15840432 DOC Fixed doc issues for utils module (#11445) 2018-07-22 15:23:11 +10:00
Ronan Lamy 5592a2eda9 [MRG] PyPy support for all but a couple of estimators (#11010) 2018-07-20 14:39:53 +10:00
Loïc Estève e1dd0d85c4 FIX: ensure that category warning are passed as a kwargs in ignore_warnings (#11599) 2018-07-17 22:50:32 +02:00
Joris Van den Bossche 007aa710bd FEA Refactor CategoricalEncoder into OneHotEncoder and OrdinalEncoder (#10523)
Deprecated some OneHotEncoder behaviour
2018-06-21 19:27:41 +10: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
Roman Yurchak d582e97944 TST Pytest parametrization part2 - cluster, datasets and decomposition modules (#11142) 2018-06-01 10:26:02 +08:00
Joris Van den Bossche 0b6308c270 FEA Add ColumnTransformer for heterogeneous data (#9012) 2018-05-30 07:49:21 +10:00
Roman Yurchak c50d9e87d0 [MRG+1] Pytest parametrize unit tests common tests and ensemble module (#11075) 2018-05-24 10:47:40 +02:00
Roman Yurchak d9a0774afc MAINT Always import signature from sklearn.utils.fixes (#11019) 2018-04-24 09:27:45 +10:00
Loïc Estève 9ea723f07a [MRG+1] Read-only memmap input data in common tests (#10663) 2018-04-23 14:58:40 +02:00
Chady Kamar 5c98de1a59 DOC: fix links to reference API in utilities.rst (#10683) 2018-02-24 19:42:44 +01:00
Albert Thomas 49da6c87dd [MRG+1] Common tests for outlier detection estimators (#9270) 2018-02-17 22:40:03 +11:00
Joel Nothman 8499a13031
[MRG] TST arch-dependent divide-by-zero warning (#10480)
Fixes #7572
2018-02-12 20:25:42 +11:00
Joel Nothman 116c96c7cc [MRG] CI Reinstate docstring testing (#10473) 2018-02-10 08:47:42 -08:00
Eric Chang c429a4d72e DOC Update docs for assertion functions in sklearn.utils.testing (#10317) 2017-12-14 09:44:08 +01:00
RAKOTOARISON Herilalaina 72fb54c767 [MRG+1] - No private setting in __init__ apart from parameters (#9450) 2017-12-13 12:19:56 +01:00
Kumar Ashutosh 87759c1924 FEA Add a new class RegressorChain similar to ClassifierChain (#9257) 2017-12-12 09:00:57 +11:00
Joris Van den Bossche a2ebb8cfd2 ENH: new CategoricalEncoder class (#9151) 2017-11-21 20:03:41 +11: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
Vinod Kumar L 340d871ab6 [MRG+1] Remove sklearn.utils.testing._assert_all_close (#10032) 2017-10-30 07:23:44 +11:00
Joan Massich 76494a1462 [MRG+1] Remove hard dependency on nose (#9670) 2017-09-10 13:21:40 +10:00
Loïc Estève 846313b570 [MRG+1] Deprecate sklearn.utils.testing.raises and remove it from tests (#9660) 2017-09-01 12:53:59 +02:00
Kumar Ashutosh 2b9405f977 [MRG] Backports msg in assert_raises and assert_raises_regex (#9536)
* Added modifiedunittest

* Backports msg in assertRaises and assertRaisesRegexp

* Import statement corrected

* Corrected import statement

* Added module name in utils.setup.py

* Removed Extra modules

* Reordered class

* _is_subtype added

* Missing import added

* _formatMessage added

* missing variables added

* Remove PEP8 failures

* Removed safe_repr

* _unittest_backport.py added

* Import statement corrected

* Added copyright

* Syntax Error removed

* Error removed

* runTest function added

* Tests added

* __init__ added

* Import added
2017-08-17 09:05:24 +10:00
Andreas Mueller 030f8b21f1 [MRG+1] add docstring tests to a travis entry that actually runs tests (#9363)
* add docstring tests to a travis entry that actually runs tests

* show skipped tests

* better test skipping messages

* use path in walk_packages so we can run the tests from anywhere.
Also try to do better tests for private packages.

* Ensure all submodule classes and functions are tested

* Reverse the for loop nesting to avoid copying

* skip abstract methods, skip setup.configure, skip a lot more that I don't want to fix.

* unused import

* move neighbors up from deprecated to just not covered.
2017-08-02 08:33:17 +10:00
Taehoon Lee 27bbdb570b Fix typos (#9320) 2017-07-12 18:05:21 +10: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
Adam Kleczewski b413299676 [MRG+1] Classifier chain (#7602)
[MRG+2] Classifier chain
2017-06-28 22:34:19 -07:00
Joel Nothman c2a42efe08 Remove unused import 2017-06-21 09:34:11 +10:00
Joel Nothman f0c5568fcd [MRG+1] FIX common test failures on Windows (#9115) 2017-06-14 23:30:10 +10:00
Joel Nothman 7ab0a96d8a Remove obsolete reference to dbscan.random_state (#9120) 2017-06-14 09:21:15 +02: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
Andreas Mueller 5c4b1bb231 [MRG+1] Housekeeping Deprecations for v0.19 (#7927)
* remove stuff to be removed 0.19

* more changes

* remove classes from 0.19 whatsnew

* remove _LearntSelectorMixin

* remove ProjectedGradientNMF, load_lwf_*

* minor fixes

* remove more copy from logistic regression path

* remove lda, qda from __init__.__all__

* remove pg solver in nmf from tests etc

* remove class_weight="auto" from tests

* doctest change for decision_function_shape="ovr"

* remove transfrom from tree test, minor fixes to tree tests

* some fixes in the tests

* undo changes in functions which still allow 1d input...

* also allow 1d in scale

* more test fixes...

* last test fixes in forest and tree

* svm default value change doctest failures

* pep8

* remove more class_weight="auto" stuff

* minor cosmetics in docstrings deprecated / removed behavior.

* say that store_covariance has been moved to __init__ in discriminant_analysis
2016-12-09 12:43:38 -05: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
Konstantin Podshumok 9b2aac9e5c [MRG + 1] [TST] (half-cosmetic) use less nose.tools import to simplify future transition to py.test (#7384)
* use less nose.tools import to simplify future transition to activly developing test suites/runners

* assert_equal -> assert_array_equal in test_feature_hasher_pairs_with_string_values

and one missed ImportError that should be replaced with AttributeError

* test for py2.6 compat with except AttributeError

* fix importing of SkipTest

* force using nose in python2.6 for now

* there was no assert_dict_equal in py2.6. but we can use assert_equal

although failed test will look a little bit ugly

* remove nose imports from doc/datasets
2016-10-07 12:46:52 -04:00
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
Joel Nothman 5b20d484ad [MRG] ENH enable setting pipeline components as parameters (#1769)
Pipeline and FeatureUnion steps may now be set with set_params, and transformers may be replaced with None to effectively remove them.

Also test and improve ducktyping of Pipeline methods
2016-08-29 23:32:42 +10:00
Joel Nothman 9539c0c00e [MRG + 1] ENH show no warning with chi2 of empty feature (#6978)
* ENH show no warning with chi2 of empty feature

* TST better error message when warnings raised

* TST fix test in old Numpy where another warning is issued
2016-07-31 09:35:19 +02:00
Sebastian Raschka 4d33cd62e4 rename function to func (#6700) 2016-07-01 21:50:40 +02:00
Thierry 6fb6c63b7b Modification of the ignore_warning function and _IgnoreWarning class. 2016-04-21 18:28:44 +02:00
Maniteja Nandana 29ee54a586 Meta estimator for multi output classification 2016-04-01 07:18:59 +05:30
Tim Head 07cede74ca Multitarget regression meta estimator
Register OneVsRestRegressor as meta estimator

Rename to a more sensible name

Parallel predict and sparse support

Started MultiOutput documentation

Move code to new file multioutput.py

Continuing the move to new multioutput module

Added sample weight support

Better test for sample weights and actually support weights

Added a new test using weighted vs repeated samples to
test sample weight support. Uncovered that weights
were not actually passed on to underlying estimator.

Comment on multiprocess overheads

Move parallel_helper to utils.fixes

This helper works around a python2 limitation on pickling
instance methods

Example of multi-output regression with gradient boosting

Switch to uniform weighted score and updated example

The example now uses a RF with and without the MultiOutput
meta estimator

Added note for removing `score` method

Addressing comments on MultiOutputRegressor

MultiOutputregressor better test for weighted samples

Fix ups

Use explicit keyword argument for passing sample weights and
fix random_state on train-test split in the example
2016-03-10 16:06:08 -05:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
Andreas Mueller 776e53b127 skip unstable tests on 32bit platform 2015-11-02 15:21:22 -05:00
Loïc Estève efe93d4cc6 MAINT update joblib to 0.9.3 2015-10-30 17:43:00 +01: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
giorgiop 6a5a2f7960 partial_fit for scalers 2015-10-13 11:37:00 +02:00
Manoj Kumar 652b950074 Merge pull request #4242 from MechCoder/select_from_model
[MRG+1] Implemented SelectFromModel meta-transformer
2015-10-10 23:15:06 -04:00