Commit Graph

69 Commits

Author SHA1 Message Date
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
Roman Yurchak 684d8a221d MAINT Use set litterals when possible (#12667) 2019-01-06 19:21:45 +08:00
Andreas Mueller 952ef6637a MRG Drop legacy python / remove six dependencies (#12639) 2019-01-03 15:50:05 +02: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
Joel Nothman c3bdc0a89a
DOC clean up assorted type specifications (#10441) 2018-01-11 09:11:17 +11:00
Joel Nothman bb4cddecae DOC clarify input to _ovr_decision_function 2018-01-08 21:48:37 +11:00
nielsenmarkus11 3a48f0ab7c [MRG+1] Raise error when SparseSeries is passed into classification metrics (#7373)
* 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
2017-10-06 17:00:39 +02:00
Joel Nothman e31c4f1e9e DOC List more utils in API ref (#8827) 2017-06-08 15:31:26 +02:00
Naoya Kanai 6579220588 [MRG+1] Drop NumPy < 1.8 (#8874) 2017-06-07 17:06:06 +02:00
Andreas Mueller 1c41368bac [MRG+1] Uncontroversial fixes from estimator tags branch (#8086)
* 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
2017-06-06 16:34:47 +02:00
Russell Smith 54b0e4bf62 Add OneVs{One,All}Classifier._pairwise: fix for #7306 (#7350) 2016-09-20 13:46:45 +02:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
Varun 299c2751ca BUG :#5782 check_classification_targets returns y instead of y_type 2015-11-10 16:02:07 -05:00
Jiali Mei 85223b9bcc a common test to check if classifiers fail when fed regression targets 2015-10-14 14:46:13 -04:00
TomDLT fecd35567e FIX array_equal for numpy < 1.8.1 2015-09-16 19:15:48 +02:00
TomDLT 628ed2c867 ENH remove some warnings in test suit 2015-09-16 18:27:58 +02:00
Raghav R V 18221db9fd FIX type_of_target will now raise ValueError on ml-seq; [[1, 2]] is mc-mo; 2015-08-11 22:27:15 +05:30
Raghav R V c031b39787 MAINT is_label_indicator_matrix --> is_multilabel 2015-08-11 22:27:15 +05:30
Raghav R V 7def0a75cd TST/MAINT reintroduce mixed types test sans seq. of seq. 2015-08-11 22:27:15 +05:30
Raghav R V 8f1ad4437f FIX 2D binary array-like must be considered as unknown 2015-08-11 22:27:14 +05:30
Raghav R V 3bd6132f25 FIX make sure empty target vectors are returned as binary 2015-08-11 22:27:14 +05:30
Raghav R V 72f6225f7b MAINT/ENH inline the logic for _is_sequence_of_sequences 2015-08-11 22:27:14 +05:30
Raghav R V b0e44c31d9 MAINT return 'unknown' for seq. of seqs in type_of_target 2015-08-11 22:26:44 +05:30
Loïc Estève 67dcd99d82 TST fix tests with numpy 1.6.1
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
2015-02-01 15:49:49 +01:00
Raghav R V b3fbccca38 FIX various mismatch between docstring and signature params
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.
2015-01-16 11:54:57 -05:00
Hamzeh Alsalhi 2198a84388 Manage explicit zeros manualy in class_distribution, test with explicit zeros 2014-08-09 10:33:35 -04:00
Hamzeh Alsalhi 1873ef867c Test explicit sample wieghts in the sparse case of class_distribution 2014-08-07 17:20:07 -04:00
Hamzeh Alsalhi 7b7784e0aa Make cosmetic changes
Break list comprehenesions differently in dummy precit

Drop uncesseray float() in multiclass class_distrribtuion

Combine two lines in random_choice_csc
2014-08-06 23:01:42 -04:00
Hamzeh Alsalhi 5ba7df8b6c Include dense case support in class_distribution, pep8 revisions
Make The function previoulsy sparse_class_distribution support both the sparse and
dense case, and make some cosmetic updates for imporved readability
2014-08-05 09:45:20 -04:00
Hamzeh Alsalhi 478f9adc23 Comment .eliminate_zeros() in sparse class distribution 2014-08-04 18:45:31 -04:00
Hamzeh Alsalhi 81f82682d6 Move test_sparse_class_distribution to utils/multiclass from utils/sparsefuncs 2014-08-04 18:24:07 -04:00
Andreas Mueller 6e2a83b4e1 remove check_arrays stuff and old input validation 2014-07-20 13:31:45 +02:00
Gael Varoquaux 81b86f1077 COSMIT: fix indentation 2014-07-17 11:44:07 +02:00
Gael Varoquaux 7768a3059b ENH: enable y to only implement the array interface
For instance y could be a pandas' dataframe
2014-07-17 11:44:07 +02:00
Gael Varoquaux bbf7ae7565 BUG: Support array interface 2014-07-17 11:44:07 +02:00
Andreas Mueller be5826d6b9 BUG: Support array interface 2014-07-16 15:30:39 +02:00
Vlad Niculae 9c1217ce5b TYPO remove mutli (did you mean Muttley?) 2014-07-15 12:09:45 +02:00
Imran Haque d709833247 Preserve public API 2014-07-04 12:50:23 -07:00
Hamzeh Alsalhi 2bfca14c49 ENH sparse matrix support in label binarization 2014-06-25 16:15:19 -04:00
Joel Nothman 28eb1ebe15 Assert or ignore all sequence of sequences deprecation warnings 2014-06-05 11:20:36 +02:00
Joel Nothman 18c399e20a MAINT deprecate sequences of sequences support
* add warnings
 * provide alternative binarizer, sklearn.preprocessing.MultiLabelBinarizer
 * fix documentation
2014-06-05 11:20:35 +02:00
Joel Nothman dbc26ce996 COSMIT remove unused imports and variables 2014-02-03 19:43:56 +11:00
Joel Nothman de7bee4f22 ENH support multiclass targets of string objects 2013-12-05 21:56:54 +11:00
Olivier Grisel 08de819b2c Rename helper partial_fit function 2013-07-25 11:16:29 +02:00
Olivier Grisel aa44a2160c Use unique_labels more consistently in the multiclass model 2013-07-25 10:21:25 +02:00
Olivier Grisel 1505af9832 Add missing test for sample weight with partial_fit + fix issue classes passed as a list instead of an array 2013-07-25 10:21:24 +02:00
Olivier Grisel 84397fb09b Factorize common classes checks in partial_fit implementations 2013-07-25 10:21:24 +02:00
Arnaud Joly da7fe8964a DOC add example is_multilabel 2013-07-22 15:49:31 +02:00
Arnaud Joly a62abe66ff ENH use a comprehension over imap 2013-07-08 13:49:25 +02:00
Arnaud Joly a9197f3dad FIX bug with indicator format 2013-07-08 13:49:25 +02:00