Commit Graph

1081 Commits

Author SHA1 Message Date
jblackburne ba7cf38f99 Removed isclose from _binary_clf_curve. (#7353)
Added a bugfix report to whats_new.rst. Modified a unit test to check for the kind of problems caused by isclose.
2016-09-11 12:48:32 +10:00
Andreas Mueller b4872fe30d [MRG] add warning when importing old or new pickle. (#7248) 2016-09-10 14:17:42 +02:00
Andreas Mueller 31a4691d76 [MRG+1] fix sampling in stratified shuffle split (#6472)
Fix sampling in stratified shuffle split, break tests that test sampling.
2016-09-09 19:00:49 +02:00
Joel Nothman 49d126fd8f [MRG + 1] FIX use high precision cumsum and check it is stable enough (#7331)
* FIX use high precision cumsum and check it is stable enough
2016-09-09 06:17:12 +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
Andreas Mueller 4a72792db4 change default iterated_power to auto. 2016-09-06 11:03:16 +02:00
Andreas Mueller 927f00ca9a fix warning and behavior in randomized_svd wrt power iterations 2016-09-06 11:03:16 +02:00
Andreas Mueller 7fc41768b1 pep8 2016-08-31 22:37:23 -04:00
Andreas Mueller 61bfe8aea8 make more explicit which checks are run 2016-08-31 18:00:55 -04:00
Olivier Grisel e94c35d902 ENH make validation message easier to understand (#7294) 2016-08-31 21:35:57 +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
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
Manoj Kumar 68b4c68f75 Merge pull request #7252 from lesteve/fix-mock-dataframe-check-array
[MRG + 1] __array__ should take an optional dtype
2016-08-26 12:20:47 -07:00
Loïc Estève 45e9c2f5b9 NotAnArray.__array__ should take an optional dtype 2016-08-26 10:19:46 +02:00
Loïc Estève 50ab94db46 MockDataFrame.__array__ should take an optional dtype 2016-08-26 10:18:35 +02:00
David Staub 277b058713 [MRG] Remove heavy memory footprint in BaseBagging due to OOB scoring (#7118)
* Remove heavy memory footprint for OOB scoring from bagging.

- Remove `estimators_samples` attribute from `BaseBagging`
- Add method `_get_estimators_samples` to `BaseBagging` that
  returns a generator producing sample indices on demand.
- Slight refactor of `_parallel_build_estimators()` to
  isolate and group lines accessing random state.

* Replaced `BaseBagging.estimators_samples_` attribute with property.

- Accessing `BaseBagging.estimators_samples_` now triggers call to
  `BaseBagging._get_estimators_samples` as well as deprecation
  warning for release 0.20.
- This should make the fix for the OOB memory issue fully backwards
  compatible.

* Remove print statement.

* Added test, made new method more general.
- Added test to `test_bagging.py` to ensure that indices generated
  on the fly are identical to indices generated at fit time.
- Refactored `_get_estimators_samples()` to `_get_estimators_indices()`,
  now both feature and samples indices are returned.
- Refactored `estimators_samples_()` to deal with above.

* Rename index generating functions and arguments.

* `estimators_samples_()` returns list instead of generator

* Removed `estimators_samples_` deprection warning.

* Actually removed `estimators_samples_` deprecation warning.

* New mask generation function, new bagging test, new BaseBagging attributes.
- Added new private function in bagging.py that converts indices to
  a boolean mask.
- Added new bagging test to make sure identical OOB scores are generated
  when the same estimator if fit with fixed random state and identical
  training data.
- Added new private attributes `BaseBagging._max_features` and
  `BaseBagging._max_samples` to store validated input values.

* Streamlined code, improved `estimators_samples_()` documentation.
- Removed `max_samples` argument from `_parallel_build_estimators()`,
  this value is now accessed via `ensemble._max_samples`.
- Removed validation of `ensemble.max_features` and `max_samples`,
  instead use `ensemble._max_features` and `ensemble._max_samples`
  which are assumed to be already validated.
- Removed unnecessary `samples` variable from `_parallel_build_estimators()`.
- Changed the way `random_state` is generated in `_parallel_build_estimators()`
  and `BaseBagging._get_estimators_data_draws()` to direct numpy method to
  reflect that seeds created in `BaseBagging._fit()` are trustworthy.
- Due to above removed generation of new seed for each estimator in
  `_parallel_build_estimators()` and `BaseBagging._get_estimators_data_draws()`.
- Added documentation to `BaseBagging.estimators_samples_()` property
  indicating the reason it's generated dynamically and the associated performance
  penalty.
- Returned `BaggingClassifier._set_oob_score()` and `BaggingRegressor._set_oob_score()`
  to directly accessing `self.estimators_samples_`.

* Streamlined code, improved `estimators_samples_()` documentation.
- Removed `max_samples` argument from `_parallel_build_estimators()`,
  this value is now accessed via `ensemble._max_samples`.
- Removed validation of `ensemble.max_features` and `max_samples`,
  instead use `ensemble._max_features` and `ensemble._max_samples`
  which are assumed to be already validated.
- Removed unnecessary `samples` variable from `_parallel_build_estimators()`.
- Changed the way `random_state` is generated in `_parallel_build_estimators()`
  and `BaseBagging._get_estimators_data_draws()` to direct numpy method to
  reflect that seeds created in `BaseBagging._fit()` are trustworthy.
- Due to above removed generation of new seed for each estimator in
  `_parallel_build_estimators()` and `BaseBagging._get_estimators_data_draws()`.
- Added documentation to `BaseBagging.estimators_samples_()` property
  indicating the reason it's generated dynamically and the associated performance
  penalty.
- Returned `BaggingClassifier._set_oob_score()` and `BaggingRegressor._set_oob_score()`
  to directly accessing `self.estimators_samples_`.

* PEP8, remove optional arguments, add public function to utils.
- Update indentation and line length to conform to PEP8.
- Update `estimators_samples_()` docstring to conform to PEP8 and
  PEP257.
- Remove optional arguments to `BaseBagging._get_estimators_data_draws()`,
  rename to `BaseBagging._get_estimators_indices()`.
- Remove optional arguments from `_generate_mask_from_indices()`,
  move to `utils.metaestimators`, rename to `indices_to_mask()`.

* Add indices_to_mask to __all__ in utils.metaestimators

* Move utils function, new test for `estimators_samples` correctness.
- Moved `indices_to_mask` from `utils.metaestimators` to `utils.validation`
- Added new test to `ensemble.test_bagging` to make sure refitting
  an individual estimator from the bagging ensemble using the corresponding
  samples identified in `BaseBagging.estimators_samples` returns the same model.

* Adjust/remove tests, move `indices_to_mask` to `utils.__init__`.
- Remove test_bagging.test_consistent_index_sampling
- Update formatting checks in test_bagging.test_estimators_samples
  to make sure each mask is numpy boolean array
- Move indices_to_mask from utils.validation to utils.__init__

* update class docstring for `estimators_samples_`

- Updated class docstring of `estimators_samples_` attribute for `BaggingClassifier` and `BaggingRegressor` to indicate that samples are identified with boolean masks.

* PEP8, made `max_samples` arg optional in _fit()
- Fixed PEP8 issues.
- Gave `max_samples` argument of `BaseBagging._fit()` a default
  value of `None` as indicated in the docstring. Added code to
  check for and process `None` value.
- Added a few more comments to `_fit()`.

* 2 new `max_samples` consistency tests, update whats_new.rst

* Minor change

* Update whats_new.rst
2016-08-23 16:59:32 +10:00
David Staub 12d5f07831 [MR] Speed issues in sample_without_replacement - bugfix (#7104)
* Remove cdivision=True Cython compiler directive causing incorrect int division.

* Decrease tol for LogisticRegression fit test, perhaps needed due to test not controlling `random_state`.
2016-08-06 21:23:19 +10:00
Gael Varoquaux 91129f35e5 Merge pull request #7119 from jrfiedler/remove-unused-imports
[MRG] Removed unused imports
2016-08-01 16:17:18 -07: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
James Fiedler e4b837cc66 Removed unused imports 2016-07-29 19:30:23 -05:00
Sebastian Raschka 4d33cd62e4 rename function to func (#6700) 2016-07-01 21:50:40 +02:00
Raghav R V afd5d18b0c [MRG] ENH Restructure grid_scores_ into a dict of 1D arrays
Also, DOC what's new section for model_selection changes
2016-06-16 12:23:04 +10:00
Gael Varoquaux 1837224751 Merge pull request #6613 from nelson-liu/correct_license_spelling
[MRG+1] DOC: fix spellings of 'license'
2016-06-15 13:58:59 +02:00
Joel Nothman f9b1365108 TST ensure tests are importable 2016-06-13 20:29:46 +10:00
Mikhail Korobov 5a333cdb93 fixed error message for invalid class_weight values 2016-06-02 01:13:57 +05:00
Joel Nothman a6a6ff6d64 Merge pull request #6785 from yenchenlin1994/make-csr_row_norms-support-fused-types
[MRG] Make csr row norms support fused types
2016-05-26 06:53:07 +10:00
Tom Dupré la Tour 1107f223d5 use class_weight through sample_weight in LogisticRegression with liblinear 2016-05-25 14:54:02 +02:00
YenChenLin c7d6f9ffc3 Test row_norms for float32 data 2016-05-25 20:29:03 +08:00
Manoj Kumar 20f89ef7a3 Remove add_row_csr (#6676) 2016-05-24 14:16:49 -07:00
YenChenLin 65e91f715c Make csr_row_norms support fused types 2016-05-19 08:49:17 +08:00
Jake VanderPlas e743cf75f5 MAINT: re-organize setup.py & make sure all tests are discoverable by nose 2016-05-13 06:57:09 -07:00
Alexandre Gramfort 7ae7ea5ea8 pep8 2016-05-09 22:55:48 +02:00
Jordi a4d070e9cd [MRG] Disabled randomized_svd warning when number of iterations is not specified #6746 (#6749) 2016-05-09 22:54:35 +02:00
Nelson Liu ec8299abfc
DOC: fix typo in check_arrays 2016-05-07 18:26:33 -07:00
xyguo 8182f4bd04 Fixing default order docs of sklearn.utils.check_array 2016-04-29 18:08:11 -04:00
Manoj Kumar 6d7dfdba24 Merge pull request #5414 from vighneshbirodkar/el
[MRG+1] Elkans K means
2016-04-26 16:08:42 -04:00
Thierry Guillemot 78a674875e Correct the deprecation of the random_integers numpy function. (#6712) 2016-04-26 16:08:48 +02:00
Vighnesh Birodkar ae51a55524 revert doc string of check_array 2016-04-22 20:14:08 -04:00
Vighnesh Birodkar 475a6b71cf Revert definition of check_array 2016-04-22 19:47:21 -04:00
Thierry 6fb6c63b7b Modification of the ignore_warning function and _IgnoreWarning class. 2016-04-21 18:28:44 +02:00
Yen 28758cc5eb [MRG+2] Use fused types in sparse mean variance functions (#6593)
* Use fused types in mean variance functions

* Add test for mean-variance functions using fused trpes

* Add whats_new
2016-04-16 11:16:05 -04:00
YenChenLin 566a0e7a3e Make cython compiler directives global 2016-04-15 15:43:57 +08:00
Olivier Grisel 2efa626f9b [MRG] Fix strict tests
* FIX test_common: assert_greater_equal(iter_, 1)

The previous check was too strict. It is fine for an estimator to
decide that is has converged in one pass over the data.

* STYLE PEP8

* FIX test_reconstruct_patches_perfect_color too strict

* STYLE flake8 fixes
2016-04-07 09:55:08 +02:00
Vighnesh Birodkar d7c44096f9 doc typo 2016-04-05 19:57:19 -04:00
Vighnesh Birodkar f46033067d docstring elaboration and typo in fixes.py 2016-04-05 19:57:19 -04:00
Vighnesh Birodkar 273e91b337 change default order in check_array and update variable names in _k_means_elkan.pyx 2016-04-05 19:57:19 -04:00
Andreas Mueller 7efeb5ab60 ENH added elkan k_means algorithm
renamed elkan -> triangle_inequality, lloyd-> full

pep8, rename _kmeans_single -> _kmeans_single_lloyd

add a docstring to elkans k-means in cython.

fixed text for full

Fixed elkans kmeans so that predict is same as labels

Added test to ensure full and triangle_inequality give same results

changed triangle_inequality to elkan

Addressed review comments

removed rebase artifacts

correct whats_new

moved enhancement bullet to 0.18

removed extra newline

strong typing dor prototype

fixed random state

removed c file

removed merge artifacts

removed entry from 0.17

Add documentation and inline_comments to _k_means_elkan.pyx

Minor rearrngement of docstring sentences

removed call to np.sort to improve speed for large number of clusters

replced logic with call to np.partition

Fallback to sort if partition does not exist

use partition from fixes rather than numpy
2016-04-05 19:57:19 -04:00
ningchi 6ce198c78f [MRG] #6581 n_samples of utils.resample can be more when replace is True
* #6581 n_samples can be more when replace is True

* more compact code
2016-04-02 08:58:40 +02:00
Manoj Kumar 3078d7d611 Merge pull request #6127 from hugobowne/MultiOneVsRestClassifier
[MRG+2] MultiOutputClassifier
2016-03-31 23:02:08 -04:00
Maniteja Nandana 29ee54a586 Meta estimator for multi output classification 2016-04-01 07:18:59 +05:30