* Improve validation messages with infinite data
* Extend and fix validation tests
* Test and fix extended error message
* data_name => input_name
* Mention estimators that natively support missing values
* More informative error message
* cosmetic
* typo
* Fix broken tests
* Fix test_knn
* Add changelog entry
* Fix broken test for param search models
* Missing input names
* Allow Y and y in estimator checks
* Add missing input names
* Fix input_name for FunctionTransformer
* More missing input names
* Update test
* More test fixes on scores
* Simplify message to avoid to make generic fallback meaningful
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
* More informative estimator checks failure messages
* Make sure the estimator name is passed correctly in _validate_data
* Simplify calls to _validate_data
* Handle estimator name in private _check_y helper
* More specific error message
* Add estimator to check_X_params and check_y_params
* Add .. versionadded flags in public docstrings
* Update changelog
* Improve _validate_data's docstring
* Typo in doc/whats_new/v1.1.rst
* Make _check_estimator_name return None if estimator == None
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
* check_params dict updates with style
* Increase test coverage
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
* unit test for _ovr_decision_function
* sigmoid scale
* error on subset test
* clearer comment on test
* new scaling function forget sigmoid
* remove exception in subset check for SVC decision_function
* add comment and update whats_new
* update comment
* change test for float imprecision
* use 1/3 instead of 1/2
* merge conflict error
* flake8 correction and assert_true replacement
* better comment
* refer to public functions
* remove reference to private function
* rst dots
* change fix comments
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.
* Raise error when SparseSeries is passed into roc_curve
* Changed "y_true" in second if block to "y_score"
* Remove code to import pandas and add sparseseries check to 'type_of_target' function. Finally, add 'type_of_target' call to _binary_clf_curve
* Remove pandas import and old comparison in roc_curve.
* Add test for 'type_of_target' function
* Add white space after commas
* Correct other white space issues
* Move type_of_target test into try clause, remove test_precision_recall_curve_pos_label since as multiclass it doesn't make sense
* Add test_precision_recall_curve_pos_label back in and also add test_binary_clf_curve to test new logic in _binary_clf_curve function
* Correct syntax and formatting.
* Remove trailing white space
* Correct validation logic
* Update test_multiclass.py per @jnothman 's request.
* Import SkipTest function.
* Remove extra white space from line 303
* some bug fixes.
* minor fixes to whatsnew
* typo in whatsnew
* add test for n_components = 1 transform in dict learning
* feature extraction doc fix
* fix broken test
* revert aggressive input validation changes
* in SelectFromModel, don't store threshold_ in transform. If we called "fit", use estimates from last "fit".
* move score from EllipticEnvelope to OutlierDetectionMixin
* revert changes to Tfidf documentation
* remove dummy input validation from whatsnew
* fix text feature tests
* rewrite from_model threshold again...
* remove stray condition
* fix self.estimator -> estimator, slightly more interesting test
* typo in comment
* Fix issues in SparseEncoder, add tests.
more explicit explanation of SparseEncoder change, add issue numbers to whatsnew
* minor fixes in whats_new.rst
* slightly more consistency with tuples for shapes
* not longer typo
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
DOC max_iterations -> max_iter. Make it consistent with kmeans
MAINT Replace the deprecated dx parameter with d in the docstrings
MAINT Deprecation warning for max_iterations parameter.
Break list comprehenesions differently in dummy precit
Drop uncesseray float() in multiclass class_distrribtuion
Combine two lines in random_choice_csc