Commit Graph

179 Commits

Author SHA1 Message Date
(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
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
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
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 6972d6c15c DOC minor doc fixes for sphinx. (#7357) 2016-09-08 10:07:40 +10: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
John Moeller 055bc4c004 pep8 2016-06-22 02:10:41 -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
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
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
Rémy Léone 9b7176dd9d [DOC] Fix broken links 2016-03-23 12:45:34 -07:00
Jake Vanderplas 7895d38ca6 Merge pull request #6372 from amueller/poly_feature_names
[MRG+2] add get_feature_names to PolynomialFeatures
2016-02-25 11:55:03 -08:00
Andreas Mueller 8fb928d644 fixed doc for powers, added test 2016-02-24 17:08:15 -05:00
Andreas Mueller 897f8b6cc6 don't do ^1 2016-02-22 15:09:47 -05:00
Andreas Mueller ddc1740207 fix PolynomialFeatures.powers_ in python 0.16.1 2016-02-19 15:53:37 -05:00
Andreas Mueller 3fa684db0e add get_feature_names to PolynomialFeatures 2016-02-19 15:52:55 -05:00
giorgiop 140a5acda8 MAINT depr of center_data, normalize in linear_model 2016-02-17 14:26:50 -05:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
Andreas Mueller fb123ed24b More doc fixes. Latex builds again. 2015-11-20 16:30:45 -05:00
MechCoder 6e87813550 Scaling a sparse matrix along axis 0 should accept a csc by default 2015-11-11 14:21:49 -05:00
KamalakerDadi f2e35411fa Added more versions of 0.17 2015-11-04 00:02:52 +01:00
KamalakerDadi 2249daaea8 Version added for all new classes 2015-11-03 23:54:42 +01:00
KamalakerDadi 468b4c15b3 Version Added for Robust Scaler 2015-11-03 23:48:23 +01:00
Andreas Mueller c55dc89902 Merge pull request #5695 from amueller/doc_fixes
[MRG] DOC some fixes to the doc build.
2015-11-03 15:24:56 -05:00
Andreas Mueller e2eba1ffbc Merge pull request #5688 from amueller/robust_scaler_1column_fix
[MRG+2] fix 1 sparse row scaling in robust scaler
2015-11-03 14:06:26 -05:00
Andreas Mueller 61df16e0e9 fix 1 sparse row scaling in robust scaler 2015-11-03 14:03:09 -05:00
Gael Varoquaux f7e886a885 Merge pull request #5682 from trevorstephens/OneHotEncoder_warn_fix
[MRG + 1] OneHotEncoder warn fix - fixes #5671
2015-11-03 19:26:08 +01:00
Andreas Mueller 2653833a07 DOC some fixes to the doc build. 2015-11-03 12:23:23 -05:00
MechCoder 1e23805861 DOC: Correct confusing docs of n_values in OneHotEncoder 2015-11-02 15:19:33 -05:00
trevorstephens 89f8a514c3 OneHotEncoder warn fix
add regression test
2015-11-02 11:04:00 -08:00
Jeffrey04 f24d94aec4 remove test for self.scale_ 2015-10-20 10:59:10 +08:00
Jeffrey04 9da9b581a4 add fix for inverse transform 2015-10-19 23:29:38 +08:00
Jeffrey04 23e39871a8 fixing MaxAbsScaler according to MinMaxScaler 2015-10-19 23:11:20 +08:00
Jeffrey04 3f86d68f71 code fix for issue #5433 2015-10-19 19:30:29 +08:00
Gilles Louppe 008adf11ad Merge pull request #5375 from rvraghav93/set_precision
[MRG + 2] FIX precision to float64 across the codebase
2015-10-19 11:02:04 +02:00
Andreas Mueller 96f587a4f2 DOC cosmit I find it confusing to say that fit resets the estimator, at it always does that. 2015-10-16 11:48:25 -04:00
giorgiop c7b1a6ebc3 BUG: reset internal state of scaler before fitting 2015-10-16 17:28:40 +02:00
Raghav R V a87011262a FIX precision to float64 across the codebase 2015-10-16 11:20:29 +02:00
Andreas Mueller c66689c4f4 FIX Don't compare arrays to strings!!!! 2015-10-15 16:07:17 -04:00
Raghav R V 21fab6e8ec FIX Move validation from helper to main function 2015-10-15 18:21:51 +02:00
Raghav R V 4f4c3598e6 FIX dtypes to conform to the stricter type cast rules of numpy 1.10
FIX set copy to (copy & whiten).

FIX/DOC Use float outputs for doctest
2015-10-15 18:21:51 +02:00
giorgiop 6a5a2f7960 partial_fit for scalers 2015-10-13 11:37:00 +02:00
Olivier Grisel 250507ffa6 FIX deprecation message for 1d data 2015-09-10 09:55:35 +02:00
Vighnesh Birodkar 2f099334f9 MAINT deprecate 1d input arrays for all estimators
Passing 1D arrays to check_array, without setting `ensure_2d` to false now
raises a deprecation warning before reshaping it. This will later throw an
error.

All Scaler classes also throw warnings when 1D arrays are passed.

All unit tests/doctests are modified to ensure that no 1D arrays are passed,
except in explicit 1D array tests where the warnings have been silenced.

Additional tests are also included which check for different 1D array cases.

2D array tests with one samples and one features are also added and where
they failed, `check_array` call has been modified to give a more useful error
message
2015-09-09 15:49:58 +02:00
Thomas Unterthiner e7e22d1e55 DOC Improve wording in minmax_scale documentation 2015-07-05 18:51:55 +02:00
Thomas Unterthiner 26fbfe6f2e ENH add minmax_scale 2015-07-01 23:27:35 +02:00
jnothman dc8578ae41 Merge pull request #4828 from untom/maxabs_scaler
[MRG] add MaxAbsScaler
2015-06-12 05:17:07 +10:00
Joel Nothman 87aaabc06a DOC backticks in attribute docstrings unnecessaru since #3489 2015-06-12 05:13:02 +10:00
Thomas Unterthiner ab734b7a39 ENH add MaxAbsScaler 2015-06-11 16:08:17 +02:00
Andreas Mueller 98ca513ad2 Merge pull request #4796 from joshloyal/standard-scaler-std-doc
[MRG+1] Updated _std docstring in StandardScaler to make internal handling of zero values explicit.
2015-06-10 13:39:11 -04:00
Andreas Mueller 0650d5502e DOC adding backlinks to docstrings 2015-06-03 00:24:04 -04:00
Joshua Loyal 75e895eb92 Updated _std docstring in StandardScaler to make internal handling of
zero values explicit.
2015-06-01 12:57:04 -04:00
Andreas Mueller 0b07536990 Merge pull request #4125 from untom/RobustScaler
[MRG + 2] ENH RobustScaler
2015-05-26 18:02:41 -04:00
Thomas Unterthiner 815270b343 Remove redundant code 2015-05-21 22:21:25 +02:00
Thomas Unterthiner cac627a696 More documentation fixes 2015-05-21 22:07:27 +02:00
Thomas Unterthiner c12ae6047b Fix documentation errors 2015-05-21 15:36:42 +02:00
TomDLT 89c1018c64 ENH improve check_array
ENH improve check_array to warn on dtype conversions

ENH make check_array accept several dtypes

ENH change validation with improved check_array

ENH change astype to avoid copy if possible

ENH remove warn_if_not_float
2015-05-19 16:13:42 +02:00
Thomas Unterthiner 2de9f374a6 Fixed documentation oversight. 2015-05-16 21:52:14 +02:00
Thomas Unterthiner 7dbe3a895f Fix robust_scaling test 2015-05-16 11:45:47 +02:00
Thomas Unterthiner d86a629ac7 Added robust scaling example 2015-05-16 11:15:32 +02:00
Thomas Unterthiner 4c6ad90d2a Remove interquartile_scale parameter 2015-05-16 11:13:31 +02:00
Thomas Unterthiner c296e4961e Fixed removal of copy-parameter 2015-05-16 01:50:42 +02:00
Thomas Unterthiner 9ffd954ea6 Fixed decprecation warning 2015-05-16 00:50:05 +02:00
Thomas Unterthiner 6aefa534e5 Improved documentation of robust scaler 2015-05-16 00:49:47 +02:00
Thomas Unterthiner 29e8377e19 Export robust_scale and RobustScaler 2015-05-16 00:08:37 +02:00
Thomas Unterthiner e5957928d3 Remove 'copy' parameter form RobustScaler functions 2015-05-15 23:48:34 +02:00
Thomas Unterthiner f7ca553d00 Remove warn_if_not_float 2015-05-15 23:47:10 +02:00
Thomas Unterthiner 50c0a8d531 Fix documentation errors. 2015-05-15 23:46:38 +02:00
CJ Carey 5fcad7cc67 Fixing sparse max for older scipy 2015-05-08 15:13:27 -04:00
CJ Carey 84ee88db79 DOC: updating Normalizer docstring for norm='max' 2015-05-08 14:22:55 -04:00
CJ Carey 9e710ed843 WIP: adding 'max' normalizer to normalize()
This still needs tests and doc updates.
2015-04-23 12:58:17 -04:00
Nicolas 04078be7da FIX make StandardScaler & scale more numerically stable
Detect common numerical stability problems in the standardization
routines and try simple mitigation strategies while alos issuing
a warning.
2015-03-23 14:32:33 +01:00
Eric Martin ed47b5b744 Directly compute polynomial features.
Polynomial features are computed by iterating over all combinations
of features. For each combination of features, the product of the
columns indexed by the combination is computed.

The fit method is now a no-op, and the transform method works with any
number of features (regardless of what fit was called with).
2015-03-18 13:07:15 +11:00
Andreas Mueller 555b859041 Fix #4351. Rendering of docs in MinMaxScaler. 2015-03-06 12:38:05 -05:00
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
Thomas Unterthiner bf8cfb6ff6 Check if parameters are fitted 2015-01-20 08:05:05 +01:00
Thomas Unterthiner 22f718dcce ENH Added RobustScaler 2015-01-19 21:13:31 +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
Raghav R V 78233b2d05 FIX scale - Raise ValueError when input contains non finite values. 2015-01-16 19:07:27 +05:30
Wu Jiang 87a823c7c7 Fix a typo in OneHotEncoder's docstring
were --> where.
2015-01-12 14:04:29 -05:00
Raghav R V abd31d2cad MAINT Make uniform the error raised for not fitted condition 2015-01-12 00:33:40 +05:30
MechCoder 72db6aeb62 DOC: Make the comment slightly clearer 2014-10-25 10:53:33 +02:00
MechCoder d71c52929a Handle_unknown option to OneHotEncoder
OneHotEncoder fails with a error that is not helpful if a missing
categorical feature is present during transformation.
Add handle_unknown with an "error" and an "ignore" option.
2014-10-24 13:23:53 +02:00
Thomas Unterthiner 52adb5cae7 ENH Add 'axis' argument to sparsefuncs.mean_variance_axis 2014-09-03 13:47:48 +02:00
Joel Nothman b3bdb08964 DOC fix formatting of attributes etc. in docstrings 2014-07-28 19:04:59 +10:00
Joel Nothman be08122e04 DOC Fix example path 2014-07-21 18:42:23 +10:00
Andreas Mueller c235c3b566 ENH add allowed_sparse named argument for @ogrisel 2014-07-20 15:31:28 +02:00