Commit Graph

328 Commits

Author SHA1 Message Date
Charlie Newey c554aad456 [MRG + 1] Fix ValueError in LabelEncoder when using inverse_transform on unseen labels (#9816) 2017-09-21 19:21:55 +02:00
Bastian Venthur 7400775633 [MRG+1] MAINT Replace assert_array_equal with -assert_array_almost_equal where necessary. (#9774) 2017-09-18 19:55:23 +10:00
Ekaterina Tuzova 540ef6d418 DOC: fix docstring of Imputer.fit (#9769) 2017-09-15 14:04:13 +10:00
Guillaume Lemaitre 89b02af431 [MRG+1] EHN Accept 1D array for preprocessing functions and update doc (#9596)
* EHN/TST robust_scale accepts 1D array

* DOC update doc for preprocessing functions
2017-08-22 19:08:47 +03:00
Naoya Kanai f6c7080ee5 DOC Clarify RobustScaler behavior with sparse input (#8858) 2017-07-29 22:23:46 +10:00
Dmitry Petrov 93c17f1380 [MRG+1] Added examples to docstrings of MinMaxScaler and StandardScaler (#9380)
[MRG+2] Added examples to docstrings of MinMaxScaler and StandardScaler
2017-07-18 15:13:10 -07: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
Sebastin Santy dc43486806 Remove unused imports (#9235) 2017-07-01 05:57:54 -07:00
Guillaume Lemaitre 076f46a152 [MRG+1] MAINT Upgrade to sphinx 1.6.2 (#9227) 2017-06-29 10:08:50 +02:00
Taehoon Lee ebf2bf8107 Fix typos (#9205) 2017-06-23 11:43:46 +02:00
(Venkat) Raghav, Rajagopalan 763d93b72e [MRG+1] Do not transform y (#9180)
* we do not transform y

* more

* added Deprecation Warning to transform() to remove Y parameter

* more

* ENH ensure FunctionTransformer's transform/inverse_transform doesn't permit y

* Undo changes to pls_. It will be done in a separate PR (see #9160)

* flake8

* Update whatsnew

* Fully undo PLS changes
2017-06-22 23:24:12 +02:00
Guillaume Lemaitre 6ff79f9416 [MRG+1] DOC add hyperlink to example (#9097)
* DOC add hyperlink to example

* Remove useless change

* DOC fix hyperlink

* DOC fix links
2017-06-10 16:13:50 +02:00
Guillaume Lemaitre 26a1027a83 [MRG+1] QuantileTransformer (#8363)
* resurrect quantile scaler

* move the code in the pre-processing module

* first draft

* Add tests.

* Fix bug in QuantileNormalizer.

* Add quantile_normalizer.

* Implement pickling

* create a specific function for dense transform

* Create a fit function for the dense case

* Create a toy examples

* First draft with sparse matrices

* remove useless functions and non-negative sparse compatibility

* fix slice call

* Fix tests of QuantileNormalizer.

* Fix estimator compatibility

* List of functions became tuple of functions
* Check X consistency at transform and inverse transform time

* fix doc

* Add negative ValueError tests for QuantileNormalizer.

* Fix cosmetics

* Fix compatibility numpy <= 1.8

* Add n_features tests and correct ValueError.

* PEP8

* fix fill_value for early scipy compatibility

* simplify sampling

* Fix tests.

* removing last pring

* Change choice for permutation

* cosmetics

* fix remove remaining choice

* DOC

* Fix inconsistencies

* pep8

* Add checker for init parameters.

* hack bounds and make a test

* FIX/TST bounds are provided by the fitting and not X at transform

* PEP8

* FIX/TST axis should be <= 1

* PEP8

* ENH Add parameter ignore_implicit_zeros

* ENH match output distribution

* ENH clip the data to avoid infinity due to output PDF

* FIX ENH restraint to uniform and norm

* [MRG] ENH Add example comparing the distribution of all scaling preprocessor (#2)

* ENH Add example comparing the distribution of all scaling preprocessor

* Remove Jupyter notebook convert

* FIX/ENH Select feat before not after; Plot interquantile data range for all

* Add heatmap legend

* Remove comment maybe?

* Move doc from robust_scaling to plot_all_scaling; Need to update doc

* Update the doc

* Better aesthetics; Better spacing and plot colormap only at end

* Shameless author re-ordering ;P

* Use env python for she-bang

* TST Validity of output_pdf

* EXA Use OrderedDict; Make it easier to add more transformations

* FIX PEP8 and replace scipy.stats by str in example

* FIX remove useless import

* COSMET change variable names

* FIX change output_pdf occurence to output_distribution

* FIX partial fixies from comments

* COMIT change class name and code structure

* COSMIT change direction to inverse

* FIX factorize transform in _transform_col

* PEP8

* FIX change the magic 10

* FIX add interp1d to fixes

* FIX/TST allow negative entries when ignore_implicit_zeros is True

* FIX use np.interp instead of sp.interpolate.interp1d

* FIX/TST fix tests

* DOC start checking doc

* TST add test to check the behaviour of interp numpy

* TST/EHN Add the possibility to add noise to compute quantile

* FIX factorize quantile computation

* FIX fixes issues

* PEP8

* FIX/DOC correct doc

* TST/DOC improve doc and add random state

* EXA add examples to illustrate the use of smoothing_noise

* FIX/DOC fix some grammar

* DOC fix example

* DOC/EXA make plot titles more succint

* EXA improve explanation

* EXA improve the docstring

* DOC add a bit more documentation

* FIX advance review

* TST add subsampling test

* DOC/TST better example for the docstring

* DOC add ellipsis to docstring

* FIX address olivier comments

* FIX remove random_state in sparse.rand

* FIX spelling doc

* FIX cite example in user guide and docstring

* FIX olivier comments

* EHN improve the example comparing all the pre-processing methods

* FIX/DOC remove title

* FIX change the scaling of the figure

* FIX plotting layout

* FIX ratio w/h

* Reorder and reword the plot_all_scaling example

* Fix aspect ratio and better explanations in the plot_all_scaling.py example

* Fix broken link and remove useless sentence

* FIX fix couples of spelling

* FIX comments joel

* FIX/DOC address documentation comments

* FIX address comments joel

* FIX inline sparse and dense transform

* PEP8

* TST/DOC temporary skipping test

* FIX raise an error if n_quantiles > subsample

* FIX wording in smoothing_noise example

* EXA Denis comments

* FIX rephrasing

* FIX make smoothing_noise to be a boolearn and change doc

* FIX address comments

* FIX verbose the doc slightly more

* PEP8/DOC

* ENH: 2-ways interpolation to avoid smoothing_noise

Simplifies also the code, examples, and documentation
2017-06-10 01:15:46 +02:00
Guillaume Lemaitre ed5bd4cb69 DOC add docstring to FunctionTransformer (#9058) 2017-06-08 15:16:05 +02:00
Naoya Kanai 6579220588 [MRG+1] Drop NumPy < 1.8 (#8874) 2017-06-07 17:06:06 +02:00
Minghui Liu 398ffed8d1 Removed DataConversionWarning in Normalize (#8712) 2017-04-25 15:11:03 -04:00
David Robles f49f8905db Incorrect number of samples in One Hot Encoder example (#8255) 2017-02-01 11:33:06 +11:00
Andreas Mueller 5c4b1bb231 [MRG+1] Housekeeping Deprecations for v0.19 (#7927)
* remove stuff to be removed 0.19

* more changes

* remove classes from 0.19 whatsnew

* remove _LearntSelectorMixin

* remove ProjectedGradientNMF, load_lwf_*

* minor fixes

* remove more copy from logistic regression path

* remove lda, qda from __init__.__all__

* remove pg solver in nmf from tests etc

* remove class_weight="auto" from tests

* doctest change for decision_function_shape="ovr"

* remove transfrom from tree test, minor fixes to tree tests

* some fixes in the tests

* undo changes in functions which still allow 1d input...

* also allow 1d in scale

* more test fixes...

* last test fixes in forest and tree

* svm default value change doctest failures

* pep8

* remove more class_weight="auto" stuff

* minor cosmetics in docstrings deprecated / removed behavior.

* say that store_covariance has been moved to __init__ in discriminant_analysis
2016-12-09 12:43:38 -05:00
Kyle Gilliam d39c273022 [MRG+1] Added override of fit_transform to LabelBinarizer (#7670)
* Added override of fit_transform to LabelBinarizer

* Updated fit_transform to call base class method

* Changed fit_transform for code consistency

* Removed whitespace on blank lines

* Fixed line wrap issues for doc gen.

* Used line cont. for term defs

* Standardized bracket usage, fixed line cont. indent level
2016-12-06 16:03:33 -05: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
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
Ang Lu c17156106c [MRG+1] Fix return_norm bug in preprocessing.normalize (#7789)
Fixes #7771
2016-11-23 09:45:32 +11:00
CJ Carey 94c2094f3e [MRG+1] BUG: MultiLabelBinarizer.fit_transform sometimes returns an invalid CSR matrix (#7750)
* BUG: MultiLabelBinarizer makes invalid CSR matrix

See https://github.com/scipy/scipy/issues/6719 for context.

The gist is that the `inverse` array may have a different dtype than `yt.indices`, which causes trouble down the line because, in those cases, `yt.indices` and `yt.indptr` have different dtypes.

Alternately, we could insert `yt.check_format(full_check=False)` after modifying the sparse matrix members.

* Fixing for old numpy

Older versions don't support kwargs for `astype`

* Adding tests

* line-wrapping

* adding comment to tests

[ci skip]

* added rationale comment

[ci skip]
2016-10-26 17:43:35 -04:00
Andreas Mueller 4da44c8541 [MRG+1] replaced some assert_true(np.allclose(x, y)) with assert_almost_equal (#7742)
* replaced some assert_true(np.allclose(x, y)) with assert_almost_equal for better error messages.

also some pep8.

* typo fixes
2016-10-25 09:15:58 -04:00
Konstantin Podshumok 9b2aac9e5c [MRG + 1] [TST] (half-cosmetic) use less nose.tools import to simplify future transition to py.test (#7384)
* use less nose.tools import to simplify future transition to activly developing test suites/runners

* assert_equal -> assert_array_equal in test_feature_hasher_pairs_with_string_values

and one missed ImportError that should be replaced with AttributeError

* test for py2.6 compat with except AttributeError

* fix importing of SkipTest

* force using nose in python2.6 for now

* there was no assert_dict_equal in py2.6. but we can use assert_equal

although failed test will look a little bit ugly

* remove nose imports from doc/datasets
2016-10-07 12:46:52 -04:00
Josh Karnofsky 9551ec85ea DOC add spaces before colons in docstrings (#7589) 2016-10-06 14:01:12 +11:00
Kathy Chen d5b66f9da9 [MRG+1] Docs: refer users to the other encoders to do one hot encoding for labels. (#7315)
* refer users to the other encoders to do one hot encoding for labels.

* added to the 'see more' for labelbinarizer, multilabelbinarizer, and labelencoder' as well as an example to multilabel binarizer

* added note about y labels to the OneHotEncoder docstring

* removed example from MultiLabelBinarizer

* documentation should specify LabelBinarizer, not MultiLabelBinarizer in OHE
2016-10-05 11:28:37 -04:00
Andreas Mueller 1dff0aec21 clean up deprecation warning stuff in common tests
minor fixes in preprocessing tests
2016-09-22 19:35:31 +05:30
Shashank Shekhar 474483efa4 Added user guide link in function_tranformer docstring (#5785)
* Added user guide link in function_tranformer docstring

* Added function_transformer tag to preprocessing user guide
2016-09-12 18:33:22 -04:00
Manoj Kumar 8da5092e83 [MRG] Fail imputer early when number of features are not the same in fit and transform (#7374) 2016-09-11 23:22:13 +10:00
Andreas Mueller 6972d6c15c DOC minor doc fixes for sphinx. (#7357) 2016-09-08 10:07:40 +10:00
Joel Nothman 0a0bf2478e Revert "ENH: Add indicator features to imputer output (#6607)" (#7292)
This reverts commit 18396be8cb as it was
merged when incomplete.
2016-08-30 21:28:01 +10:00
Andreas Mueller 002ff1237a fix some warnings in test outputs. 2016-08-27 17:02:22 +02:00
Caio Oliveira 19d6d925ed [MRG+1] Fix for "_transform_selected" not copying when "selected='all'" (#7201)
* fixes issue scikit-learn/scikit-learn#7194

* Added test

* Making `selected='all'` explicit on test

* Updated whats_new.rst

* Fixed typo on `whats_new.rst`
2016-08-18 11:47:00 +02:00
Alexandre Gramfort 02806e9782 cosmit 2016-08-13 11:03:59 +02:00
Konstantin Podshumok f893565773 [MRG+2] ENH: (minor) add quantile_low/high parameters to robust scaler (#5929)
* add quantile_low/high parameters to robust scaler

add versionadded tags

* robust scaler: add parameter for quantile_range, check its validity

* robust scaler: simplify params validations

fix typo in docstrings of RobustScaler

* preprocessing.data fix some lines > 80 columns

* add whatsnew for robust scaler quantile_range param

add missing url link in whatsnew
2016-08-13 10:32:16 +02:00
Óscar Nájera 8034b2926e more examples references 2016-08-03 20:23:50 +02:00
Gael Varoquaux 1dbc069cab TST: Speed up: cv=2
This is a smoke test. Hence there is no point having cv=4
2016-06-22 15:39:53 +02:00
John Moeller 055bc4c004 pep8 2016-06-22 02:10:41 -06:00
John Moeller 13f68c93b8 Simplifying imports and test 2016-06-17 17:44:51 -06:00
John Moeller cc9dbac37f Adding test for PR #6900 2016-06-17 17:28:36 -06:00
John Moeller 2242b1b2ea Make KernelCenterer a _pairwise operation
Replicate solution to 9a520779c2 except that `_pairwise` should always be `True` for `KernelCenterer` because it's supposed to receive a Gram matrix. This should make `KernelCenterer` usable in `Pipeline`s.

Happy to add tests, just tell me what should be covered.
2016-06-16 22:49:36 -06:00
Kevin Wang a2498218ac DOC cross-reference preprocessing estimators and functions in their docstrings 2016-05-10 11:00:41 +02:00
Thierry Guillemot 78a674875e Correct the deprecation of the random_integers numpy function. (#6712) 2016-04-26 16:08:48 +02:00
Maniteja Nandana 18396be8cb ENH: Add indicator features to imputer output 2016-04-14 12:21:16 +05:30
ningchi 1d487fb550 [MRG+1] issue #6532 Add `inverse_transform` function (#6570)
* [MRG+1] #6532 Add inverse_func argument to FunctionTransformer


* modify test:inverse_func is not true inverse
2016-04-12 01:26:30 -04:00
Toshihiro Kamishima 45ff64bdec type echecking before comparison, to avoid warning of multiple comparison (#6615) 2016-04-11 17:52:42 +02:00
Alexandre Gramfort acdaeaf5dd Merge pull request #6606 from tkamishima/tkamishima_one_hot_encoder_parameter_checking
[MRG] type checking before comparison, to avoid warning messages, in preprocessing.OneHotEncoder
2016-03-31 22:33:55 +02:00
Manoj Kumar 24198ffbb8 Merge pull request #6419 from nelson-liu/fix_linkcheck
[MRG+1] DOC: Fix broken links
2016-03-30 18:17:48 -04:00
Toshihiro Kamishima d574a03497 type checking before comparison, to avoid warning messages
If np.array is pssed  as a parameter 'n_values', warning of multiple comparison is printed. This patch avoid this problem.
2016-03-31 01:09:15 +09:00