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.
* 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
* 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
* 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.
* 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
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
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
np.bincount raises an Exception with empty input arrays for numpy versions < 1.6.2
Add utils.fixes.bincount to tackle this issue and use it instead of np.bincount