Commit Graph

142 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 acb8106472 MNT Use list and dict comprehension (#12668) 2019-01-08 09:32:34 +11:00
Andreas Mueller 952ef6637a MRG Drop legacy python / remove six dependencies (#12639) 2019-01-03 15:50:05 +02:00
Olivier Grisel e67e30cec2 Fix numpy vstack on generator expressions (#12467)
* Workaround vstack issue with genxp

* Use list comprehensions instead of genexps with np.vstack

* Add changelog entry.
2018-10-29 11:40:05 -04:00
Roman Feldbauer 60cf1d62d2 Fix numpy.int overflow in make_classification (#10811) 2018-10-02 14:15:56 +02:00
ZJ Poh adddf00433 [MRG] np.ones -> np.full (#11628) 2018-07-23 09:49:01 +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
Taehoon Lee 328b04f43e MNT Fix typos (#11057) 2018-05-03 16:30:05 +08:00
Adam Richie-Halford 3b037b0e28 [MRG+1] Reference glossary in random_state docstring entries in datasets module (#10732)
* Reference glossary in random_state docstring entries in datasets module

* Add note about reproducibility to random_state docstring entries

* Fix default value in random_state docstring entries

* Revert fix of flake8 'line too long' error. Deemed off topic for this PR

* Remove surrounding spaces from equals sign in docstrings

* Change all '`random_state <Glossary>`' to '`Glossary <random_state>`'
2018-03-25 09:54:30 +11:00
Adam Richie-Halford b8a1bcf986 DOC Explicitly document feature order in `make_classification` docstring (#10731) 2018-03-02 09:27:26 +11:00
Mohamed Maskani 34f12da6d6 ENH make_blobs takes list/array as n_samples argument (#10577) 2018-02-14 20:58:27 +11:00
ksemb 77418a0275 MAINT Fix escape sequences that are deprecated in Python 3.6 (#10578)
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
2018-02-07 10:41:21 +11:00
Christian Braune 4bead39f78 FIX make_circles() now works with odd number of samples, test added (#10045) 2017-11-11 23:14:37 +11:00
Joel Nothman 0ea26cd12b PEP8 2017-10-17 09:27:56 +11:00
jkleint 538a706710 DOC Clarify docs for `make_classification` (#9918) 2017-10-17 08:26:06 +11:00
Sachin Kelkar 9d515e960a Fix 9865: Change code and add test (#9890) 2017-10-10 11:27:38 +02:00
(Venkat) Raghav, Rajagopalan b6f8865b0a [MRG + 1 (rv) + 1 (alex) + 1] Add a check to test the docstring params and their order (#9206)
* add automatic test of docstrings for function / method signatures using numpydoc
2017-07-11 18:42:10 +02:00
RAKOTOARISON Herilalaina 046141ba5e [MRG+1] Make classification (dimensions > 30) (#9045)
* Change _generate_hypercube into rng.randint

* Improve unit test

* Test if each row is unique
2017-06-08 14:12:57 +02:00
Naoya Kanai 6579220588 [MRG+1] Drop NumPy < 1.8 (#8874) 2017-06-07 17:06:06 +02:00
Guillaume Lemaitre e3c9ae204f [MRG+1] DOC improve description and consistency of random_state (#8689)
* DOC improve description of random_state in train_test_split

* DOC Make random_state consistent through documentation

* FIX reverse doc mistake

* FIX address comment of Tom

* DOC address comments

* DOC remove empty line

* DOC remove unecessary white spaces
2017-04-05 17:43:21 -07:00
Josh Levy aea6462b81 [MRG+1] Fixes #8198 - error in datasets.make_moons (#8199) 2017-01-17 13:37:42 +11:00
Joel Nothman 8570622a44 [MRG+1] DOC insert spaces before colons in parameter lists (#7920)
* DOC insert spaces before colons in parameter lists

Complies with numpydoc to improve rendering and automatic quality
assurance such as #7793. Affects listings of Parameters Attributes,
Returns.

Performed with the help of:

    grep -nE '^(    )+[a-zA-Z][a-zA-Z0-9_]*: ' sklearn -R | grep -v -e
    externals -e tests | grep -v -e default: -e else: -e Warning: -e Note:
    -e TRAIN: -e Default: -e True: -e False: -e DOI: -e In: | gsed
    's|\([^:]*\):\([0-9]*\):\([^:]*\):\(.*\)|--- a/\1\n+++ b/\1\n@@ -\2,1
    +\2,1 @@\n-\3:\4\n+\3 :\4|' | git apply --unidiff-zero -

* DOC fix numpydoc format for param
2016-11-25 10:59:22 +01:00
yangarbiter fa59873857 [MRG+1] FIX unstable cumsum (#7376)
* FIX unstable cumsum in utils.random

* equal_nan = true for isclose
since numpy < 1.9 sum is as unstable as cumsum, fallback to np.cumsum

* added axis parameter to stable_cumsum

* FIX unstable sumsum in ensemble.weight_boosting and utils.stats

* FIX axis problem in stable_cumsum

* FIX unstable cumsum in mixture.gmm and mixture.dpgmm

* FIX unstable cumsum in cluster.k_means_, decomposition.pca, and manifold.locally_linear

* FIX unstable sumsum in dataset.samples_generator

* added docstring for parameter axis of stable_cumsum

* added comment for why fall back to np.cumsum when np version < 1.9

* remove unneeded stable_cumsum

* added stable_cumsum's axis testing

* FIX numpy docstring for make_sparse_spd_matrix

* change stable_cumsum from error to warning
2016-10-17 15:49:23 +02:00
Josh Karnofsky 9551ec85ea DOC add spaces before colons in docstrings (#7589) 2016-10-06 14:01:12 +11:00
Rémy Léone 9b7176dd9d [DOC] Fix broken links 2016-03-23 12:45:34 -07:00
Harry Mavroforakis b50d3ed37e Fixes make_sparse_spd_matrix documentation
Updates the documentation of the parameter alpha in make_sparse_spd_matrix() to reflect its effect in sparsity.
2016-01-28 17:00:34 -05:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
KamalakerDadi f2e35411fa Added more versions of 0.17 2015-11-04 00:02:52 +01:00
Joel Nothman 71c99dc73c FIX error introduced during rebase 2015-08-30 23:19:01 +10:00
Kashif Rasul aaae2db9dc make_multilabel_classification sparse target
for issue #3554
2015-08-30 23:00:29 +10:00
Raghav R V 7e828db722 MAINT remove unused import warnings 2015-08-11 22:27:15 +05:30
Raghav R V 6fb17a1f95 FIX revert generation of seq of seq in make_multilabel_classification 2015-08-11 22:27:15 +05:30
Raghav R V 664d78eb7c MAINT Remove support for the deprecated sequence of sequences
MAINT Remove sequence of sequence support from datasets
MAINT Remove return_indicator param
MAINT Remove multilabel-seq test in OVR
MAINT Remove multilable-seq test in check_cv
MAINT Remove multilabel seq test in label_binarizer
TST type_of_target returns "unknown" for multilabel-sequence types
TST _check_targets should raise a ValueError
DOC show multilabel indicator as an example; remove return_indicator param
DOC use consistent lower case y for target
2015-08-11 22:26:44 +05:30
Phil Roth b26e8794d7 allowing for different cluster stds 2015-07-11 16:52:57 -05:00
Andreas Mueller 0650d5502e DOC adding backlinks to docstrings 2015-06-03 00:24:04 -04:00
Andreas Mueller 6beacc3fb6 remove deprecated stuff from 0.17 2015-03-18 14:49:04 -04: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
Andreas Mueller c970fb51e7 COSMIT spelling 2015-01-15 15:09:35 -05:00
Olivier Grisel fd57806755 MAINT remove integer warnings under Python 3 + numpy 1.8+ 2014-10-08 13:33:53 +02:00
Joel Nothman 787e4a0cea DOC extend documentation on sample generators
Also allow make_multilabel_classification to return underlying
distributions.
2014-08-25 19:36:58 +10:00
Joel Nothman e58764feab DOC more explicit parameter descriptions in make_multilabel_classification 2014-08-20 00:06:00 +10:00
Joel Nothman a52085f6ac DOC correct default value 2014-08-13 12:58:23 +10:00
Andreas Mueller 6e2a83b4e1 remove check_arrays stuff and old input validation 2014-07-20 13:31:45 +02:00
Joel Nothman 5ea6b3ac95 COSMIT in response to @arjoly's comments 2014-07-08 11:13:58 +02:00
Joel Nothman e633f25233 ENH make_multilabel_classification for large n_features: faster and sparse output support 2014-07-08 11:13:58 +02:00
Lars Buitinck cdd2279c09 ENH fix astype usage to prevent copying
Removed where possible; using copy=False (from utils.fixes) where needed.

Also some C integer type fixes to gradient boosting.
2014-06-18 11:01:28 +02:00
Andreas Mueller 55ecfa2c32 COSMIT TYPO 2014-06-08 21:45:40 +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
Lars Buitinck 23b3cc2eb5 MAINT drop support for SciPy < 0.9
TODO: get rid of solve_triangular. Just replacing it by scipy.linalg's
breaks OMP and least-angle regression.
2014-03-02 20:13:57 +01:00
Chen Liu f657d9c1ee using floor division in python3 2014-01-28 15:12:21 -05:00