Commit Graph

121 Commits

Author SHA1 Message Date
Thomas J. Fan 06d6f8a9f6
FIX Passes global configuration when spawning joblib jobs (#17634)
* WIP

* BUG Passes context to joblib jobs

* BUG Fix

* BUG Fix

* CLN Moves delayed into fixes

* CLN Adds linter

* REV Revert diff

* DOC Adds comment for removal

* Use a simple implementation
2020-09-21 16:59:42 +02:00
Hirofumi Suzuki c29092d699
MNT define a parse_version function in sklearn.utils.fixes (#17670)
Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2020-06-24 13:35:49 +02:00
Lucy Liu f93f560bb9
ENH add support for sample weights in MAE (#17225) 2020-05-27 15:03:43 +02:00
Nicolas Hug cbe9f08e35
MNT Put back and properly deprecate MaskedArray (#17199) 2020-05-13 08:52:25 +02:00
Nicolas Hug 946fddec7b
BUG Fix instability issue of ARDRegression (with speedup) (#16849) 2020-04-23 10:19:45 -04:00
Roman Yurchak 5a4340834d
Fix mypy errors (#16726) 2020-03-30 15:41:05 +02:00
Roman Yurchak 75d3f29e72
MAINT Remove outdated numpy and scipy backports (#16725)
* Remove unecessary numpy & scipy backports

* More fixes

* Remove unused imports
2020-03-20 13:57:18 +01:00
Adrin Jalali 42706ebf2d
MNT CI dropping python-3.5 (#15106)
* dropping python-3.5

* fix install guide

* fix setup.py

* fix circleci

* advanced_installation

* index.html

* readme

* pyparsing.py

* remove clean_warning_registry

* 1.13.1 and 1.19.1

* don't use 16.04

* 18.04 libatlas-dev -> libatlas-base-dev

* min pillow version for 3.6 is 4.2.1

* echo commands

* fix conflict, and 32 bit

* fix conflict for circle

* fix scikit-image version dep

* mark tests as xfail on 32bit py3.6

* move to 1.13.3 min numpy version, and simplify old code

* remove the rest of _object_dtype_isnan usages

* Revert "remove the rest of _object_dtype_isnan usages"

This reverts commit c6e867ea1f.

* fix issues raised by jeremy

* minor fix

* minor fixes mentioned by Olivier
2020-02-10 12:28:42 +01:00
mschaffenroth 847b3468c7 MNT Remove utils.fixes.parallel_helper (#15232) 2019-10-14 07:45:10 -04:00
Scott Sievert 7cb5dafebb FEA Implements log-uniform random variable (#11232) 2019-10-02 13:56:24 +02:00
Guillaume Lemaitre 2e8ce318c6 EHN update lobpcg from scipy master (#14971) 2019-09-16 13:39:53 +02:00
Tim Staley 42659232bd Fix ARDRegression accuracy issue with scipy 1.3.0 (#14067) 2019-07-27 13:23:40 -04:00
Guillaume Lemaitre b8ab214967 FIX vendor lobpcg for scipy < 1.3 which incorporates bug fixes (#14195) 2019-06-26 17:23:17 +02:00
Roman Yurchak 1015caf54d MAINT Remove imports from sklearn.utils._joblib (#13676)
* Remove sklearn.utils._joblib imports

* Lint

* More fixes
2019-06-18 18:37:14 +04:00
Roman Yurchak cf9a740598 [MRG+1] Use astype(.., copy=False) when possible (#11973)
* Use astype(.., copy=False) when possible

* Use Use astype(.., copy=False) also in tests

* Fix CI

* Guillaume's comments

* Address review comments

* Add what's new

* Fix CI

* Lint

* Fix merge issues

* More merge conflict fixes

* Fix failing test

* Lint

* Use copy=True in cluster/hierarchical

* More fixes
2019-03-01 11:07:10 +01:00
Hanmin Qin 16100944b9 MNT Remove utils.fixes.euler_gamma (#13082) 2019-02-04 21:32:23 +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
Adrin Jalali 2bd87f6ed8 Remove python < 3.5 from CI (#12746) 2018-12-14 10:53:12 +01:00
jeremiedbb 4e8194909c FIX remove FutureWarning in _object_dtype_isnan and add test (#12567) 2018-11-12 21:28:05 +08:00
Joel Nothman 1128094271 BLD we should ensure continued support for joblib 0.11 (#12350) 2018-11-06 22:10:23 +01:00
Nicolas Hug 6d15840432 DOC Fixed doc issues for utils module (#11445) 2018-07-22 15:23:11 +10: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
Guillaume Lemaitre f8adfa27ae [MRG] Ignore and pass-through NaNs in RobustScaler and robust_scale (#11308) 2018-07-05 16:34:31 +02:00
Gael Varoquaux 106bb9e7f5 MAINT: option to unvendor joblib (#11166) 2018-06-29 16:35:45 +02:00
Guillaume Lemaitre c1bc665958 ENH ignore NaNs in PowerTransformer (#11306) 2018-06-22 08:22:24 +10:00
jeremiedbb 0d8a04bd17 [MRG+1] SimpleImputer(strategy="constant") (#11211) 2018-06-20 17:20:33 +02:00
Guillaume Lemaitre b9f3758dfd MAINT add function to ignore nan in min/max sparse functions (#11196) 2018-06-07 06:57:30 +10:00
Guillaume Lemaitre c3548a8e29 [MRG] EHN handle NaN value in QuantileTransformer (#10437) 2018-04-21 19:06:10 +02:00
Joel Nothman df3f7b3b50 PEP8 2018-02-28 15:24:05 +11:00
Loïc Estève e9e623156a MAINT: fix typo in scipy version comment 2018-02-27 14:58:59 +01:00
Joris Van den Bossche a2ebb8cfd2 ENH: new CategoricalEncoder class (#9151) 2017-11-21 20:03:41 +11:00
Naoya Kanai 95aa2952e1 Add logsumexp and comb to utils.fixes (#9046) 2017-06-10 15:01:02 +02:00
Naoya Kanai 6579220588 [MRG+1] Drop NumPy < 1.8 (#8874) 2017-06-07 17:06:06 +02:00
Naoya Kanai bd0fc236e0 [MRG+1] MAINT drop SciPy < 0.13 (#8854)
Remove sklearn.utils.fixes functions that are not needed for scipy >= 0.13 and keep deprecated wrappers in other modules.
2017-06-02 23:36:33 +02:00
Peter Wang 4ab99c75b4 [MRG+1] FIX Correct depth formula in iforest (#8576)
* Fixed depth formula in iforest

* Added non-regression test for issue #8549

* reverted some whitespace changes

* Made changes to what's new and whitespace changes

* Update whats_new.rst

* Update whats_new.rst

* fixed faulty whitespace

* faulty whitespace fix and change to whats new

* added constants to iforest average_path_length and the according non regression test

* COSMIT

* Update whats_new.rst

* Corrected IsolationForest average path formula and added integer array equiv test

* changed line to under 80 char

* Update whats_new.rst

* Update whats_new.rst

* reran tests

* redefine np.euler_gamma

* added import statement for euler_gammma in iforest and test_iforest

* changed np.euler_gamma to euler_gamma

* fix small formatting issue

* fix small formatting issue

* modified average_path_length tests

* formatting fix + removed redundant tests

* fix import error

* retry remote server error

* retry remote server error

* retry remote server error

* re-added some iforest tests

* re-added some iforest tests
2017-03-14 16:50:23 +01:00
willduan 1f278e1c23 Fix version comparison for the numpy 1.12 beta (#7902) 2016-12-05 10:22:26 +01: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
Antoine Wendlinger 74a9756fa7 [MRG+2] Norm inconsistency between RFE and SelectFromModel (was _LearntSelectorMixin) #2121 (#6181)
* Norm inconsistency between RFE and SelectFromModel (was _LearntSelectorMixin) #2121

* safe_pwr utility

* Norm fix

* Removed safe_pwr

* 1D arrays support for norm fix

* Test case for 2d coef in SelectFromModel

* Fix numpy version requirement for norm fix

* Implement fixes suggested by @jnothman

* Add numpy version requiring the fix.
2016-10-24 14:01:49 -04:00
Raghav RV 868a58b2e0 [MRG+1] FIX Make sure GridSearchCV and RandomizedSearchCV are pickle-able (#7594)
* FIX Subclass a new MaskedArray which allows pickling even when dype=object

* TST unpickling too

* FIX Use MaskedArray from utils.fixes rather than from numpy

* FIX imports

* Don't assign a variable

* FIX np --> numpy

* Use tostring instead of tobytes for old numpy

* COSMIT pickle-able --> picklable

* use #noqa comment to turn off flake8

* TST/ENH Check if the pickled est's predict matches with the original one's
2016-10-10 15:33:44 -04:00
Andreas Mueller 280c70bf4f add numpy versions for backports / fixes 2016-10-04 11:20:12 -04:00
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
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
Vighnesh Birodkar f46033067d docstring elaboration and typo in fixes.py 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
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
Raghav R V a87011262a FIX precision to float64 across the codebase 2015-10-16 11:20:29 +02:00
Olivier Grisel 6966881328 MAINT use inspect.signature for introspection 2015-09-23 16:30:53 +02:00
TomDLT fecd35567e FIX array_equal for numpy < 1.8.1 2015-09-16 19:15:48 +02:00
TomDLT 792e529519 add fetch_rcv1 2015-07-16 12:29:00 +02:00
Olivier Grisel f9eb9cfbee STYLE whitespace around operator in sklearn.utils.fixes 2015-04-13 11:20:36 -04:00